aws-cloudformation / aws-cloudformation-resource-providers-cloudformation

The CloudFormation Resource Provider Package For AWS CloudFormation
https://aws.amazon.com/cloudformation/
Apache License 2.0
48 stars 35 forks source link

Make ModuleDefaultVersion ListHandler conform to contract tests #112

Closed MalikAtalla-AWS closed 1 year ago

MalikAtalla-AWS commented 1 year ago

The contract tests expect that the ListHandler returns the default module versions, not the module itself.

Currently, when we invoke the ListHandler we get the Module arns like this:

aws cloudcontrol list-resources --type-name AWS::CloudFormation::ModuleDefaultVersion --region us-west-2
{
    "ResourceDescriptions": [
        {
            "Identifier": "arn:aws:cloudformation:us-west-2:123:type/module/Malik-mm-mm-MODULE",
            "Properties": "{\"ModuleName\":\"Malik::mm::mm::MODULE\",\"Arn\":\"arn:aws:cloudformation:us-west-2:123:type/module/Malik-mm-mm-MODULE\"}"
        }
    ],
    "TypeName": "AWS::CloudFormation::ModuleDefaultVersion"
}

But, the expected output according to the resource contract is like this:

{
    "ResourceDescriptions": [
        {
            "Identifier": "arn:aws:cloudformation:us-west-2:123:type/module/Malik-mm-mm-MODULE/00000001",
            "Properties": "{\"ModuleName\":\"Malik::mm::mm::MODULE\",\"Arn\":\"arn:aws:cloudformation:us-west-2:123:type/module/Malik-mm-mm-MODULE\"}"
        }
    ],
    "TypeName": "AWS::CloudFormation::ModuleDefaultVersion"
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.