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

awscc_fis_experiment_template Issues with ASG parameter: availabilityzoneIdentifiers #2003

Closed
junkeiro opened this issue Sep 9, 2024 · 5 comments
Assignees

Comments

@junkeiro
Copy link

junkeiro commented Sep 9, 2024

Terraform CLI and Terraform AWS Cloud Control Provider Version

Terraform version: 1.9.0
awscc version: 1.13.0

Affected Resource(s)

  • awscc_fis_experiment_template

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "awscc_fis_experiment_template" "fis_ec2Fis" {
  description = "Dynamic FIS EC2"
  role_arn    = aws_iam_role.iam_ec2Fis.arn

  actions = {
    "TEAM-EC2-action" = {
      name        = "TEAM-EC2-action"
      action_id   = "aws:ec2:asg-insufficient-instance-capacity-error"
      description = "EC2 Dynamic FIS by tf-fis-modules"

      targets = {
        AutoScalingGroups = "TEAM-EC2-target"
      }

      parameters = {
        "availabilityzoneIdentifiers" = "usw2-az1"
        "duration"                    = "PT10M"
        "percentage"                  = "100"
      }
    }
  }
...
...

Debug Output

TERRAFORM PLAN Succeeding shows:

resource "awscc_fis_experiment_template" "fis_ec2Fis" {
      + actions                = {
          + "TEAM-EC2-action" = {
              + action_id   = "aws:ec2:asg-insufficient-instance-capacity-error"
              + description = "EC2 Dynamic FIS"
              + parameters  = {
                  + "availabilityzoneIdentifiers" = "usw2-az1"
                  + "duration"                    = "PT10M"
                  + "percentage"                  = "100"
                }
              + start_after = (known after apply)
            }
............

TERRAFORM APPLY ignoring the availabilityZoneIdentifiers parameter:

│ Error: AWS SDK Go Service Operation Incomplete
│ 
│   with awscc_fis_experiment_template.fis_ec2Fis,
│   on main.tf line 13, in resource "awscc_fis_experiment_template" "fis_ec2Fis":
│   13: resource "awscc_fis_experiment_template" "fis_ec2Fis" {
│ 
│ Waiting for Cloud Control API service CreateResource operation completion
│ returned: waiter state transitioned to FAILED. StatusMessage: Missing value
│ for required parameter "availabilityZoneIdentifiers" in action
│ "TEAM-EC2-action". (Service: AWSFIS; Status Code: 400; Error Code:
│ ValidationException; Request ID: xxxxxx-xxxxxxxxxxxx-xxxxxx;
│ Proxy: null). ErrorCode: InvalidRequest

Expected Behavior

Terraform apply not having issues with the parameter: availabilityzoneIdentifiers

Actual Behavior

Terraform apply phase isn't including the value of availabilityzoneIdentifiers parameter

Steps to Reproduce

  1. terraform init
  2. Use the provider either 'aws' or 'awscc' to create the resource aws_fis_experiment_template or awscc_fis_experiment_template
  3. Have in action_id the value 'aws:ec2:asg-insufficient-instance-capacity-error'
  4. Provide at least the parameters availabilityzoneIdentifiers and duration (use reference links)
  5. terraform apply

Important Factoids

As mentioned before, terraform plan is passing successfully showing the parameters correctly. Terraform apply seems to be ignoring availabilityzoneIdentifiers parameter thus throws error.

References

FIS ASG Action
Terraform AWSCC fis_experiment_template

@quixoticmonk
Copy link
Collaborator

quixoticmonk commented Sep 9, 2024

Thank you for opening the issue @junkeiro . Have you tried it with availabilityZoneIdentifiers ? I see the documentation states it should be availabilityzoneIdentifiers and the API seems to want availabilityZoneIdentifiers. I will try to check the parameter references and test it on my side if this is a documentation issue.

@quixoticmonk
Copy link
Collaborator

Confirmed with the service team that the parameter key should be availabilityZoneIdentifiers. Please retest the deployment with the camel case input.

@junkeiro
Copy link
Author

Thanks a lot for the tip, it worked!! I didn't see that "Z" in uppercase in the Terraform apply phase.
Is there any place in the documenation to know about that?, neither AWS or Terraform has this parameter specified at API call level.

@quixoticmonk
Copy link
Collaborator

Documentation will be updated soon based on the feedback I received. As a rule of thumb, these parameters will be camelCased.

@quixoticmonk
Copy link
Collaborator

Documentation has been updated to reflect the camelCased keys. Closing the issue based on this. Please re-open if you the issue has not been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants