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

Terraform requires arguments that are optional when creating aws_iot_topic_rule #6195

Closed
jeandek opened this issue Oct 18, 2018 · 3 comments · Fixed by #7471
Closed

Terraform requires arguments that are optional when creating aws_iot_topic_rule #6195

jeandek opened this issue Oct 18, 2018 · 3 comments · Fixed by #7471
Labels
bug Addresses a defect in current functionality. service/iot Issues and PRs that pertain to the iot service.
Milestone

Comments

@jeandek
Copy link
Contributor

jeandek commented Oct 18, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.8

Affected Resource(s)

  • aws_iot_topic_rule

Terraform Configuration Files

resource "aws_iot_topic_rule" "client_id_mapping" {
  name        = "${var.env_name}_client_id_mapping"
  enabled     = "true"

  sql = <<EOF
SELECT clientId, {"key": "value"} as mapping
FROM '$$aws/events/subscriptions/subscribed/#' 
EOF

  sql_version = "2016-03-23"

  dynamodb {
    hash_key_field  = "client_id"
    hash_key_value  = "$${clientId}"
    hash_key_type   = "STRING"
    range_key_field = ""
    range_key_value = ""
    payload_field   = "$${mapping}"
    table_name      = "${var.env_name}_client_id_mapping"
    role_arn        = "${aws_iam_role.client_id_mapping_role.arn}"
  }
}

Debug Output

>>> terraform apply --var-file=../../../variables/dev.tfvar
Error: aws_iot_topic_rule.client_id_mapping: "dynamodb.0.range_key_field": required field is not set
Error: aws_iot_topic_rule.client_id_mapping: "dynamodb.0.range_key_value": required field is not set

Expected Behavior

These range_key arguments of the DynamoDB action are optional according to the AWS API reference and the resource's TF documentation.

Actual Behavior

Both arguments are marked as required in the source code.

References

@jeandek
Copy link
Contributor Author

jeandek commented Oct 18, 2018

The fix is probably to set "Optional: true" in the source code for both arguments, but I'm not comfortable enough with Go and Terraform to write tests for it...

@nywilken nywilken added bug Addresses a defect in current functionality. service/iot Issues and PRs that pertain to the iot service. labels Feb 5, 2019
@bflad bflad added this to the v1.59.0 milestone Feb 13, 2019
@bflad
Copy link
Contributor

bflad commented Feb 13, 2019

The fix for this has been merged and will release with version 1.59.0 of the Terraform AWS Provider, likely in the next day or two. 👍

@ghost
Copy link

ghost commented Mar 31, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
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