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.82k stars 9.17k forks source link

[Bug]: aws_ssm_parameter resource not creating body of SSM webhook #28001

Open LNrichH opened 1 year ago

LNrichH commented 1 year ago

Terraform Core Version

1.3.5

AWS Provider Version

4.40.0

Affected Resource(s)

aws_ssm_parameter

Expected Behavior

A body should be created in the SSM automation webhook.

Actual Behavior

An error is thrown. However, the webhook is created but with an empty body.

If a different string replaces "body", for example "payload", no error is produced but again a webhook with no body is created.

Relevant Error/Panic Output Snippet

module.apps.module.asg-terminate-hook.aws_ssm_parameter.test-webhook: Modifying... [id=/d9d01087-4a3f-49e0-b0b4-d568d7826553/ssm/integrations/webhook/OpsgenieWebhook]
╷
│ Error: error updating SSM Parameter (/d9d01087-4a3f-49e0-b0b4-xxxxxxxxxx/ssm/integrations/webhook/OpsgenieWebhook): ValidationException: The content of the integration structure for integration type: webhook is invalid: Invalid integration configuration. Required values are either missing, or unsupported fields have been specified for this configuration.
│   status code: 400, request id: 009edbd2-4a03-4266-9571-xxxxxxxxxx
│ 
│   with module.apps.module.asg-terminate-hook.aws_ssm_parameter.test-webhook,
│   on ../../modules/asg-terminate-hook/terminate-lifecycle.tf line 112, in resource "aws_ssm_parameter" "test-webhook":
│  112: resource "aws_ssm_parameter" "test-webhook" {
│

Terraform Configuration Files

resource "aws_ssm_parameter" "test-webhook" { name = "/d9d01087-4a3f-49e0-b0b4-d568d7826553/ssm/integrations/webhook/test-webhook" type = "SecureString" data_type = "aws:ssm:integration" # 15/11/22 This data type now supported by Terraform value = <<VAL { "description": "Interact with Opsgenie Datahub_sysOps API", "url": "https://api.eu.opsgenie.com/v2/alerts", "body": "{ "message" : "SSM_ASG_scaledown_test" }", "headers": { "Content-Type": "application/json", "Authorization":"${local.opsgenie_auth}", "Method":"POST" } } VAL }

Steps to Reproduce

Run terraform against the above code snippet

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue