aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.1k stars 53 forks source link

[AWS::Route53Profiles::ProfileAssociation] [BUG] Route53Profiles unable to find vpc #2044

Closed n3mawashi closed 1 month ago

n3mawashi commented 1 month ago

Name of the resource

AWS::Route53Profiles::ProfileAssociation

Resource Name

AWS::Route53Profiles::ProfileAssociation

Issue Description

When creating an association between VPC and Profile API complains that resource doesn't exist. However if I go to the console I can create it just fine.

Expected Behavior

VPC association should be created.

Observed Behavior

Resource handler returned message: "Can't find the resource with ID "arn:aws:ec2:ap-southeast-2::vpc/vpc-0dbcce45527fca94f (https://ap-southeast-2.console.aws.amazon.com/vpcconsole/home?region=ap-southeast-2#VpcDetails:VpcId=vpc-0dbcce45527fca94f)". (Service: Route53Profiles, Status Code: 400, Request ID: 487cabf7-6c9b-413e-96ce-576979f42927)" (RequestToken: b2bd188c-5068-6269-1e56-a231cac4d25b, HandlerErrorCode: GeneralServiceException)

Test Cases

code I used.

R53EndProfileAssociation:
    Type: AWS::Route53Profiles::ProfileAssociation
    Properties:
      Name: !Sub "${NamingPrefix}-${EnvType}-${AWS::Region}-R53-RPAssoc-End"
      ProfileId: !Ref R53AwsProfile
      ResourceId: !Sub arn:aws:ec2:${AWS::Region}::vpc/${EndVpcId}

Unfortunatey GetAtt VpcId doesn't provide an Arn hence the hand crafted version.

Other Details

image

amruthcAmazon commented 1 month ago

Customer provided VPC Arn instead of VPC Id(vpc-0dbcce45527fca94f) in the ProfileAssociation request properties for ResourceId. So the service was unable to identify the VPC.