Skip to content

resource/aws_lb_listener: Update validation and flattener and expander for mutual_authentication #35452

@gdavison

Description

@gdavison

Description

In the AWS API, the valid values for MutualAuthenticationAttributes depends on the value of Mode.

When the mode is off, no other values can be set.
When the mode is passthrough, only TrustStoreArn can be set.
When the mode is validate, both TrustStoreArn and IgnoreClientCertificateExpiry can be set, and IgnoreClientCertificateExpiry should default to false.

The provider schema currently defaults ignore_client_certificate_expiry to false in all cases, and allows both ignore_client_certificate_expiry and trust_store_arn to be set regardless of the value of mode.

  • Add a plan modifier to ignore_client_certificate_expiry to default to false only if mode is validate, and null otherwise Has to be handled in flatteners and expanders in SDK
  • Add a validator to only allow ignore_client_certificate_expiry to be set if mode is validate
  • Add a validator to only allow trust_store_arn to be set and required it if mode is validate
  • Add a validator to only allow advertise_trust_store_ca_names to be set if mode is validate

This is a breaking change

Affected Resource(s) and/or Data Source(s)

aws_lb_listener

Potential Terraform Configuration

No response

References

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

Labels

breaking-changeIntroduces a breaking change in current functionality; usually deferred to the next major release.enhancementRequests to existing resources that expand the functionality or scope.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions