-
Notifications
You must be signed in to change notification settings - Fork 3
Run deploy template
Reference: AWS cloudformation commands
All commands are written to be run in the deploy-templates directory. You can run them from another location, but will need to update the file paths accordingly.
|
Reference: AWS cloudformation - create-stack command
The command is shown with example values for parameters. See the descriptions below the command for information on how to determine the correct values to use. |
aws cloudformation create-stack --stack-name lookup-server \
--profile lookup-cloudformation-user \
--template-body file://./aws-deploy.yaml \
--parameters file://./deploy-parameters.env \
--role-arn arn:aws:iam::<your_account_id>:role/qa-role \
--capabilities CAPABILITY_NAMED_IAM
where,
-
--stack-name
- a unique name to hold the created resources. You will get an error if a stack with the name already exists. -
--profile
- is the name of the credentials in.aws/credentials
as setup in Required Permissions. Use the same profile as used for theaws-resources.yaml
template. -
--template-body
- the path toaws-deploy.yaml
template -
--parameters
- the path todeploy-parameters.env
created in the Set deploy parameters -
--role-arn
- your AWS Administrator will provide you this value which identifies the role that is executing the command. Use the same role as used for theaws-resources.yaml
template -
--capabilities CAPABILITY_NAMED_IAM
- indicates that you are aware that this template can affect permissions in your AWS account (e.g. create new AWS Identity and Access Management (IAM) users)
WARNING: The command will likely fail if you try to execute it across multiple lines. It is separated into multiple lines for readability. Substitute your values into the single line command below. |
For your convenience, the following command is single line with default values (you will still need to substitute your value for --role-arn
):
aws cloudformation create-stack --stack-name lookup-server --profile lookup-cloudformation-user --template-body file://./aws-deploy.yaml --parameters file://./deploy-parameters.env --role-arn arn:aws:iam::<your_account_id>:role/qa-role --capabilities CAPABILITY_NAMED_IAM
The steps for checking the status of the stack creation process are the same as used for the first template. See Check the status of the resource stack for more information.
The steps for deleting the stack are the same as used for the first template. See Delete the resource stack for more information.
WARNING: Running this command cannot be undone. The resources will be destroyed. |
You can confirm the status of the stack creation process and get information about the outputs of the resource allocation template in the CloudFormation Console.
- find the stack with the name you used for
--stack-name
while executing thecreate-stack
command - the status should be
CREATE_COMPLETE
when the create process completes (If the status isCREATE_IN_PROGRESS
, the create process is still running.) - click on the stack's name
- click on the Outputs tab
If the status for the stack is CREATE_COMPLETE
, the deploy is complete. From Outputs tab, you can see what was created.
- Cluster
- LoadBalancer
- Service
- TaskDefinition
Previous | [Next](Setup DNS record and SSL cert)