Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: apply deletes aws_emr_security_configuration becasue of ExternalId #37526

Open
apwrk opened this issue May 15, 2024 · 1 comment
Open
Labels
bug Addresses a defect in current functionality. service/emr Issues and PRs that pertain to the emr service.

Comments

@apwrk
Copy link

apwrk commented May 15, 2024

Terraform Core Version

1.5.0

AWS Provider Version

5.48.0

Affected Resource(s)

  • aws_emr_security_configuration

Expected Behavior

With no change in aws_emr_security_configuration resource block apply should not delete and create security configuration.

Actual Behavior

Provider deletes and creates the security configuration in AWS account even though there is no change in the resource block.

Here is what the terraform plan shows

  # module.aws_infra.module.access_layer.module.sagemaker[0].module.servicecatalog_emr.aws_emr_security_configuration.sagemaker must be replaced
+/- resource "aws_emr_security_configuration" "sagemaker" {
      ~ configuration = jsonencode(
          ~ {
              ~ AuthorizationConfiguration = {
                  ~ IAMConfiguration           = {
                      ~ ApplicationScopedIAMRoleConfiguration = {
                          - ExternalId              = "XXXXXXXXXXXXXXXXXXXXXX" -- NOT THE REAL ONE
                            # (1 unchanged attribute hidden)
                        }
                        # (1 unchanged attribute hidden)
                    }
                    # (1 unchanged attribute hidden)
                }
                # (1 unchanged attribute hidden)
            } # forces replacement
        )
      ~ creation_date = "2024-05-15T07:50:43Z" -> (known after apply)
      ~ id            = "sagemaker-emr-security-configuration20240515075043015500000001" -> (known after apply)
      ~ name          = "sagemaker-emr-security-configuration20240515075043015500000001" -> (known after apply)
        # (1 unchanged attribute hidden)
    }

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_emr_security_configuration" "sagemaker" {
  name_prefix = "sagemaker-emr-security-configuration"
  configuration = jsonencode(
    {
      "EncryptionConfiguration" : {
        "EnableAtRestEncryption" : true,
        "AtRestEncryptionConfiguration" : {
          "S3EncryptionConfiguration" : {
            "EncryptionMode" : "SSE-KMS",
            "AwsKmsKey" : var.kms_s3_data_lake_key_arn
          },
          "LocalDiskEncryptionConfiguration" : {
            "EncryptionKeyProviderType" : "AwsKms",
            "AwsKmsKey" : var.kms_s3_data_lake_key_arn
          }
        },
        "EnableInTransitEncryption" : true,
        "InTransitEncryptionConfiguration" : {
          "TLSCertificateConfiguration" : {
            "CertificateProviderType" : "PEM",
            "S3Object" : format("s3://%s/%s", aws_s3_object.emr_transit_encryption_certs.bucket, aws_s3_object.emr_transit_encryption_certs.key)
          }
        }
      }
      "AuthorizationConfiguration" : {
        "IAMConfiguration" : {
          "EnableApplicationScopedIAMRole" : true,
          "ApplicationScopedIAMRoleConfiguration" : {
            "PropagateSourceIdentity" : true,
          }
        },
        "LakeFormationConfiguration" : {
          "AuthorizedSessionTagValue" : "Amazon EMR"
        }
      }
    }
  )
}

Steps to Reproduce

create resource aws_emr_security_configuration by doing terraform apply and then do a terraform plan.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@apwrk apwrk added the bug Addresses a defect in current functionality. label May 15, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/emr Issues and PRs that pertain to the emr service. label May 15, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 15, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/emr Issues and PRs that pertain to the emr service.
Projects
None yet
Development

No branches or pull requests

2 participants