Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 356e430

Browse files
Updated the readme to include the instructions for resource registrat… (#35)
* Updated the readme to include the instructions for resource registration #33 * Correct the sample template to have ExternalConnections instead of ExternalConnections #34 * Automating the copy paste for role ARN
1 parent ce89f28 commit 356e430

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,54 @@ These resource providers can be tested by running the following commands through
1919
Run 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
2237
aws 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
3046
Run 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
3364
aws 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

sample-templates/json/create-repository-with-external-connection.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"DomainName": {
2121
"Ref": "DomainName"
2222
},
23-
"ExternalConnection": [
23+
"ExternalConnections": [
2424
{
2525
"Ref": "ExternalConnection"
2626
}

0 commit comments

Comments
 (0)