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

[Enhancement]: Support for all AWS FIS Action targets #35299

Closed
ebarros29 opened this issue Jan 14, 2024 · 3 comments · Fixed by #35300
Closed

[Enhancement]: Support for all AWS FIS Action targets #35299

ebarros29 opened this issue Jan 14, 2024 · 3 comments · Fixed by #35300
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/fis Issues and PRs that pertain to the fis service.
Milestone

Comments

@ebarros29
Copy link

Description

AWS FIS has support for many Action targets according to it's documentation, however the aws_fis_experiment_template resource does not support the below action targets:

  • Auto Scaling groups – Amazon EC2 Auto Scaling groups
  • Buckets – Amazon S3 buckets
  • Encrypted global tables – Amazon DynamoDB; global tables encrypted with a customer managed key
  • ReplicationGroups – ElastiCache Redis Replication Groups
  • TransitGateways – Transit gateways

Error message after executing terraform plan:

╷
│ Error: expected action.0.target.0.key to be one of ["Cluster" "Clusters" "DBInstances" "Instances" "Nodegroups" "Pods" "Roles" "SpotInstances" "Subnets" "Tasks" "Volumes"], got Tables
│ 
│   with aws_fis_experiment_template.example,
│   on main.tf line 1, in resource "aws_fis_experiment_template" "example":
│    1: resource "aws_fis_experiment_template" "example" {
│ 
╵
╷
│ Error: expected action.1.target.0.key to be one of ["Cluster" "Clusters" "DBInstances" "Instances" "Nodegroups" "Pods" "Roles" "SpotInstances" "Subnets" "Tasks" "Volumes"], got AutoScalingGroups
│ 
│   with aws_fis_experiment_template.example,
│   on main.tf line 1, in resource "aws_fis_experiment_template" "example":
│    1: resource "aws_fis_experiment_template" "example" {
│ 
╵
╷
│ Error: expected action.2.target.0.key to be one of ["Cluster" "Clusters" "DBInstances" "Instances" "Nodegroups" "Pods" "Roles" "SpotInstances" "Subnets" "Tasks" "Volumes"], got ReplicationGroups
│ 
│   with aws_fis_experiment_template.example,
│   on main.tf line 1, in resource "aws_fis_experiment_template" "example":
│    1: resource "aws_fis_experiment_template" "example" {
│ 
╵
╷
│ Error: expected action.3.target.0.key to be one of ["Cluster" "Clusters" "DBInstances" "Instances" "Nodegroups" "Pods" "Roles" "SpotInstances" "Subnets" "Tasks" "Volumes"], got TransitGateways
│ 
│   with aws_fis_experiment_template.example,
│   on main.tf line 1, in resource "aws_fis_experiment_template" "example":
│    1: resource "aws_fis_experiment_template" "example" {
│ 
╵
╷
│ Error: expected action.4.target.0.key to be one of ["Cluster" "Clusters" "DBInstances" "Instances" "Nodegroups" "Pods" "Roles" "SpotInstances" "Subnets" "Tasks" "Volumes"], got Buckets
│ 
│   with aws_fis_experiment_template.example,
│   on main.tf line 1, in resource "aws_fis_experiment_template" "example":
│    1: resource "aws_fis_experiment_template" "example" {
│ 
╵

Affected Resource(s) and/or Data Source(s)

  • aws_fis_experiment_template

Potential Terraform Configuration

resource "aws_fis_experiment_template" "test" {
  description = "test-experiment-template"
  role_arn    = var.fis_iam_role_arn

  stop_condition {
    source = "none"
  }

  action {
    name      = "asg-action"
    action_id = "aws:ec2:asg-insufficient-instance-capacity-error"

    parameter {
      key = "duration"
      value = "PT5M"
    }

    parameter {
      key = "availabilityZoneIdentifiers"
      value = "use1-az2"
    }

    target {
      key   = "AutoScalingGroups"
      value = "AutoScalingGroups-Target-2"
    }
  }

  action {
    name      = "bucket-action"
    action_id = "aws:s3:bucket-pause-replication"

    parameter {
      key = "duration"
      value = "PT5M"
    }

    parameter {
      key = "region"
      value = "eu-south-1"
    }

    target {
      key   = "Buckets"
      value = "Buckets-Target-4"
    }
  }

  action {
    name      = "dynamodb-action"
    action_id = "aws:dynamodb:encrypted-global-table-pause-replication"

    parameter {
      key = "duration"
      value = "PT5M"
    }
    
    target {
      key   = "Tables"
      value = "Tables-Target-3"
    }
  }

  action {
    name      = "elasticache-action"
    action_id = "aws:elasticache:interrupt-cluster-az-power"

    parameter {
      key = "duration"
      value = "PT5M"
    }
    
    target {
      key   = "ReplicationGroups"
      value = "ReplicationGroups-Target-5"
    }
  }

  action {
    name      = "tgw-action"
    action_id = "aws:network:transit-gateway-disrupt-cross-region-connectivity"

    parameter {
      key = "duration"
      value = "PT5M"
    }

    parameter {
      key = "region"
      value = "eu-south-1"
    }

    target {
      key   = "TransitGateways"
      value = "TransitGateways-Target-1"
    }
  }

  target {
    name           = "AutoScalingGroups-Target-2"
    resource_type  = "aws:ec2:autoscaling-group"
    selection_mode = "ALL"

    resource_tag {
      key   = "env"
      value = "example"
    }
  }

  target {
    name           = "Buckets-Target-4"
    resource_type  = "aws:s3:bucket"
    selection_mode = "ALL"

    resource_tag {
      key   = "env"
      value = "example"
    }
  }

  target {
    name           = "ReplicationGroups-Target-5"
    resource_type  = "aws:elasticache:redis-replicationgroup"
    selection_mode = "ALL"

    parameters = {
      availabilityZoneIdentifier = "us-east-1a"
    }

    resource_tag {
      key   = "env"
      value = "example"
    }
  }

  target {
    name           = "Tables-Target-3"
    resource_type  = "aws:dynamodb:encrypted-global-table"
    selection_mode = "ALL"

    resource_tag {
      key   = "env"
      value = "example"
    }
  }

  target {
    name           = "TransitGateways-Target-1"
    resource_type  = "aws:ec2:transit-gateway"
    selection_mode = "ALL"

    resource_tag {
      key   = "env"
      value = "example"
    }
  }

  tags = {
    Name = "test-experiment-template"
  }
}

References

Would you like to implement a fix?

Yes

@ebarros29 ebarros29 added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 14, 2024
@github-actions github-actions bot added the service/fis Issues and PRs that pertain to the fis service. label Jan 14, 2024
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.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 14, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jan 16, 2024
@github-actions github-actions bot added this to the v5.34.0 milestone Jan 24, 2024
Copy link

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

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 Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/fis Issues and PRs that pertain to the fis service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants