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

r/aws_emr_cluster: bootstrap_action.args empty string value not sent to AWS #32735

Closed
ewbankkit opened this issue Jul 28, 2023 · 5 comments · Fixed by #32956
Closed

r/aws_emr_cluster: bootstrap_action.args empty string value not sent to AWS #32735

ewbankkit opened this issue Jul 28, 2023 · 5 comments · Fixed by #32956
Assignees
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/emr Issues and PRs that pertain to the emr service.
Milestone

Comments

@ewbankkit
Copy link
Contributor

ewbankkit commented Jul 28, 2023

terraform apply this configuration:

resource "aws_emr_cluster" "test" {
  bootstrap_action {
    path = "s3://${aws_s3_object.testobject.bucket}/${aws_s3_object.testobject.key}"
    name = "test"

    args = ["1",
      "",
      "3"
    ]
  }
}

A subsequent terraform plan shows a diff:

~ bootstrap_action {
          ~ args = [ # forces replacement
                "1",
              + "",
                "3",
            ]

func ExpandStringList(configured []interface{}) []*string {
vs := make([]*string, 0, len(configured))
for _, v := range configured {
val, ok := v.(string)
if ok && val != "" {
vs = append(vs, aws.String(v.(string)))
}
}
return vs
}

@github-actions
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.

@ewbankkit ewbankkit changed the title r/aws_emr_cluster: bootstrap_action.args empty string value not sent to AWS r/aws_emr_cluster: bootstrap_action.args empty string value not sent to AWS Jul 28, 2023
@github-actions github-actions bot added the service/emr Issues and PRs that pertain to the emr service. label Jul 28, 2023
@ewbankkit ewbankkit changed the title r/aws_emr_cluster: bootstrap_action.args empty string value not sent to AWS r/aws_emr_cluster: bootstrap_action.args empty string value not sent to AWS Jul 28, 2023
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Jul 28, 2023
@ewbankkit
Copy link
Contributor Author

Testing a modified version of the resource that does send the empty string ("") values to the AWS API still results in a diff as the DescribeCluster call returns the bootstrap action arguments without the empty string.
I have verified that if an empty string really does need to be passed to the bootstrap script

    args = ["1",
      "\"\"",
      "3"
    ]

works.

@ewbankkit ewbankkit closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
@YakDriver YakDriver reopened this Aug 10, 2023
@YakDriver YakDriver self-assigned this Aug 10, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 10, 2023
@YakDriver
Copy link
Member

YakDriver commented Aug 10, 2023

Terraform takes the empty string in the args []interface{} as nil. In other words, an empty args in the config becomes a nil that is !ok in if v, ok := v.(string); ok {.

@github-actions github-actions bot added this to the v5.12.0 milestone Aug 10, 2023
@github-actions github-actions bot removed the bug Addresses a defect in current functionality. label Aug 10, 2023
@github-actions
Copy link

This functionality has been released in v5.12.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/emr Issues and PRs that pertain to the emr service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants