I am try to find resources and their arn which were created by cdk automatically ( like IAM roles and policies as dependent resources)
I can see in the cloudformation physical id there is physical id but there is hyperlink to it like other resources plus I am not able to find those resources by their physical id in the console.
I am not able to find those resources by their physical id in the console.
I do not think AWS allows to search by arbitrary text and find proper resource associated with it.
What you can do is print list of resources created by given stack
aws cloudformation list-stack-resources --stack-name <YOUR_STACK_NAME_HERE> \
| jq -r '.StackResourceSummaries[] | [.ResourceType, .PhysicalResourceId] | @tsv'
and apply some post-processing to analyze ResourceType and create links for known types.
For example, script below detects IAM roles and EMR clusters and prints links to such kind of resources
aws cloudformation list-stack-resources --stack-name <YOUR_STACK_NAME_HERE> \
| jq -r '.StackResourceSummaries[] | [.ResourceType, (\
if .ResourceType == "AWS::IAM::Role" then "https://console.aws.amazon.com/iamv2/home#/roles/details/"+.PhysicalResourceId \
elif .ResourceType == "AWS::EMR::Cluster" then "https://console.aws.amazon.com/elasticmapreduce/home#cluster-details:"+.PhysicalResourceId \
else .PhysicalResourceId \
end)] | @tsv'
However, it will require continuous maintenance for this script when you start creating more and more different ResourceTypes
Note, aws cloudformation
has two similar commands - describe-stack-resources
and list-stack-resources
. Former is limited, quote from their documentation
Note: Only the first 100 resources will be returned. If your stack has more resources than this, you should use ListStackResources instead.