hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.77k stars 9.12k forks source link

[Bug]: unable to use aws_sns_platform_application to rotate (expired) platform applications #28269

Open flokli opened 1 year ago

flokli commented 1 year ago

Terraform Core Version

1.1.7

AWS Provider Version

4.3.0

Affected Resource(s)

Expected Behavior

I'm using some aws_sns_platform_application resources to manage various push credentials, including APNS push credentials.

You normally use certificates for this, and these certificates expire after a while. The value can be observed in the Attributes.AppleCertificateExpirationDate key.

Once the certificates expire, AWS sets Attributes.Enabled to false.

In terraform world, the platform_credential and platform_principal are used for the private key and certificate respectively.

I'd provide a privkey/certificate on these two keys. I'd expect Terraform to update the credentials whenever I change them, and in case the application got disabled due to the old certificate being expired, I'd expect it to re-enable the application.

Actual Behavior

There's some SNS Platform applications with an expiration date in the past, so it looks like the certificates didn't get updated, even though terraform shows state matches configuration. Also, some applications stayed disabled.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_sns_platform_application" "apns_application" {
  name                = "apns_application"
  platform            = "APNS"
  platform_credential = "<APNS PRIVATE KEY>"
  platform_principal  = "<APNS CERTIFICATE>"
}

Steps to Reproduce

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue