Skip to content

Commit

Permalink
Add support for aws_autoscaling_schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
kishaningithub committed Sep 30, 2024
1 parent fffd11d commit 97689be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func computeResourceID(resource parser.TerraformResource) string {
return getValue("arn")
case "aws_wafv2_web_acl":
return fmt.Sprintf("%s/%s/%s", getValue("id"), getValue("name"), getValue("scope"))
case "aws_autoscaling_schedule":
return fmt.Sprintf("%s/%s", getValue("autoscaling_group_name"), getValue("scheduled_action_name"))
default:
return getValue("id")
}
Expand Down
16 changes: 16 additions & 0 deletions pkg/convertor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,22 @@ func Test_ComputeTerraformImportForResource(t *testing.T) {
SupportsImport: true,
},
},
{
name: "For aws_autoscaling_schedule",
terraformResource: parser.TerraformResource{
Address: "aws_autoscaling_schedule.test",
Type: "aws_autoscaling_schedule",
AttributeValues: map[string]any{
"autoscaling_group_name": "autoscaling_group_name",
"scheduled_action_name": "scheduled_action_name",
},
},
expected: TerraformImport{
ResourceAddress: "aws_autoscaling_schedule.test",
ResourceID: "autoscaling_group_name/scheduled_action_name",
SupportsImport: true,
},
},
{
name: "For everything else",
terraformResource: parser.TerraformResource{
Expand Down

0 comments on commit 97689be

Please sign in to comment.