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]: IoT Core Provisioning Template Ignores Updates to Pre-Provisioning Hook ARN #37323

Closed
PeterBurner opened this issue May 7, 2024 · 5 comments · Fixed by #37152
Closed
Labels
bug Addresses a defect in current functionality. service/iot Issues and PRs that pertain to the iot service.
Milestone

Comments

@PeterBurner
Copy link

PeterBurner commented May 7, 2024

Terraform Core Version

1.8.2

AWS Provider Version

5.47.0

Affected Resource(s)

  • aws_iot_provisioning_template

Expected Behavior

Changing the value of the pre_provisioning_hook.target_arn property should update the provisioning template.

Actual Behavior

Changing the value of the pre_provisioning_hook.target_arn property does not update the provisioning template. It continues to contain the old ARN, which breaks functionality. Devices cannot be provisioned anymore.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_iam_role" "test" {
  name = "test"

  assume_role_policy = jsonencode({
    Version = "2012-10-17"
    Statement = [
      {
        Effect = "Allow"
        Principal = {
          Service = "iot.amazonaws.com"
        }
        Action = "sts:AssumeRole"
      }
    ]
  })
}

resource "aws_iam_role_policy_attachment" "test" {
  role       = aws_iam_role.test.name
  policy_arn = "arn:aws:iam::aws:policy/service-role/AWSIoTThingsRegistration"
}

resource "aws_iot_provisioning_template" "test" {
  name                  = "test"
  provisioning_role_arn = aws_iam_role.test.arn
  enabled               = true

  template_body = jsonencode({
    Parameters = {
      SerialNumber = { Type = "String" }
    }

    Resources = {
      certificate = {
        Properties = {
          CertificateId = { Ref = "AWS::IoT::Certificate::Id" }
          Status        = "Active"
        }
        Type = "AWS::IoT::Certificate"
      }
    }
  })
}

Steps to Reproduce

  1. Deploy example
  2. Add pre_provisioning_hook { target_arn = "arn:aws:lambda:eu-central-1:000000000000:function:test" } to aws_iot_provisioning_template resource
  3. Deploy again
  4. See that provisioning template is missing pre-provisioning hook

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

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

github-actions bot commented May 7, 2024

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 service/iam Issues and PRs that pertain to the iam service. service/iot Issues and PRs that pertain to the iot service. labels May 7, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 7, 2024
@justinretzolk justinretzolk removed service/iam Issues and PRs that pertain to the iam service. needs-triage Waiting for first response or review from a maintainer. labels May 7, 2024
@DanielRieske
Copy link
Contributor

Hi @PeterBurner 👋, thanks for reporting this issue, I will fix this as part of the iot SDKv2 migration PR.

Copy link

github-actions bot commented Jul 2, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

Copy link

github-actions bot commented Jul 5, 2024

This functionality has been released in v5.57.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!

Copy link

github-actions bot commented Aug 7, 2024

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 Aug 7, 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. service/iot Issues and PRs that pertain to the iot service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants