Skip to content

Commit

Permalink
Add support for aws_cognito_user_pool_client
Browse files Browse the repository at this point in the history
  • Loading branch information
kishaningithub committed Jun 17, 2024
1 parent 8594722 commit 7d55084
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 @@ -60,6 +60,8 @@ func computeResourceID(resource parser.TerraformResource) string {
return fmt.Sprintf("%s|%s", getValue("plan_id"), getValue("id"))
case "aws_vpc_endpoint_route_table_association":
return fmt.Sprintf("%s/%s", getValue("vpc_endpoint_id"), getValue("route_table_id"))
case "aws_cognito_user_pool_client":
return fmt.Sprintf("%s/%s", getValue("user_pool_id"), getValue("id"))
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 @@ -299,6 +299,22 @@ func Test_ComputeTerraformImportForResource(t *testing.T) {
SupportsImport: true,
},
},
{
name: "For aws_cognito_user_pool_client",
terraformResource: parser.TerraformResource{
Address: "aws_cognito_user_pool_client.test",
Type: "aws_cognito_user_pool_client",
AttributeValues: map[string]any{
"user_pool_id": "user_pool_id",
"id": "id",
},
},
expected: TerraformImport{
ResourceAddress: "aws_cognito_user_pool_client.test",
ResourceID: "user_pool_id/id",
SupportsImport: true,
},
},
{
name: "For everything else",
terraformResource: parser.TerraformResource{
Expand Down

0 comments on commit 7d55084

Please sign in to comment.