@@ -19,22 +19,54 @@ These resource providers can be tested by running the following commands through
1919Run this command to register a private resource for ` AWSdevToolsBeta::CodeArtifact::Domain ` in ` us-east-1 `
2020
2121```
22+ # First install the domain execution role
23+ aws cloudformation create-stack \
24+ --template-url https://codeartifact-cfn-beta.s3-us-west-2.amazonaws.com/domain-resource-execution-role.yml \
25+ --stack-name domain-resource-execution-role \
26+ --capabilities CAPABILITY_IAM
27+
28+ aws cloudformation wait stack-create-complete \
29+ --stack-name domain-resource-execution-role
30+
31+ # Get the value of the ExecutionRoleArn Output
32+ export STACK_ROLE_NAME=$(aws cloudformation describe-stacks \
33+ --stack-name domain-resource-execution-role \
34+ | jq -r '.Stacks[] | select(.StackName == "domain-resource-execution-role") | .Outputs[] | select(.OutputKey == "ExecutionRoleArn") | .OutputValue')
35+
36+ # Register the domain resource
2237aws cloudformation register-type \
2338 --region us-east-1 \
2439 --type RESOURCE \
2540 --type-name "AWSdevToolsBeta::CodeArtifact::Domain" \
26- --schema-handler-package "s3://codeartifact-cfn-beta/awsdevtoolsbeta-codeartifact-domain-1.0.zip"
41+ --schema-handler-package "s3://codeartifact-cfn-beta/awsdevtoolsbeta-codeartifact-domain-1.0.zip" \
42+ --execution-role $STACK_ROLE_NAME
2743```
2844
2945## Register a CodeArtifact repository resource provider with the AWS CLI
3046Run this command to register a private resource for ` AWSdevToolsBeta::CodeArtifact::Repository ` in ` us-east-1 `
3147
3248```
49+ # First install the repository execution role
50+ aws cloudformation create-stack \
51+ --template-url https://codeartifact-cfn-beta.s3-us-west-2.amazonaws.com/repository-resource-execution-role.yml \
52+ --stack-name repository-resource-execution-role \
53+ --capabilities CAPABILITY_IAM
54+
55+ aws cloudformation wait stack-create-complete \
56+ --stack-name repository-resource-execution-role
57+
58+ # Get the value of the ExecutionRoleArn Output
59+ export STACK_ROLE_NAME=$(aws cloudformation describe-stacks \
60+ --stack-name repository-resource-execution-role \
61+ | jq -r '.Stacks[] | select(.StackName == "repository-resource-execution-role") | .Outputs[] | select(.OutputKey == "ExecutionRoleArn") | .OutputValue')
62+
63+ # Register the repository resource
3364aws cloudformation register-type \
3465 --region us-east-1 \
3566 --type RESOURCE \
3667 --type-name "AWSdevToolsBeta::CodeArtifact::Repository" \
37- --schema-handler-package "s3://codeartifact-cfn-beta/awsdevtoolsbeta-codeartifact-repository-1.0.zip"
68+ --schema-handler-package "s3://codeartifact-cfn-beta/awsdevtoolsbeta-codeartifact-repository-1.0.zip" \
69+ --execution-role $STACK_ROLE_NAME
3870```
3971
4072## Sample CloudFormation templates
0 commit comments