- Mastering AWS CloudFormation
- Karen Tovmasyan
- 268字
- 2021-06-30 14:55:37
Creating your first stack
I'm sure you've done this before.
We begin by developing our template first. This is going to be a simple S3 bucket. I'm going to use YAML template formatting, but you may use JSON formatting if you wish:
MyBucket.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: This is my first bucket
Resources:
MyBucket:
Type: AWS::S3::Bucket
Now we just need to create the stack with awscli:
$ aws cloudformation create-stack \
--stack-name mybucket\
--template-body file://MyBucket.yaml
After a while, we will see our bucket created if we go to the AWS console or run aws s3 ls.
Now let's add some public access to our bucket:
MyBucket.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: This is my first bucket
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: PublicRead
Let's run the update operation:
$ aws cloudformation update-stack \
--stack-name mybucket \
--template-body file://MyBucket.yaml
To clean up your workspace, simply delete your stack using the following command:
$ aws cloudformation delete-stack --stack-name mybucket
Let's now look at the CloudFormation IAM permissions.
- 樂學Windows操作系統
- 零起點學Linux系統管理
- Linux系統文件安全實戰全攻略
- Ansible權威指南
- 蘋果電腦玩全攻略 OS X 10.8 Mountain Lion
- Hands-On DevOps with Vagrant
- 精解Windows8
- Linux就該這么學
- 蘋果OS X Mavericks 10.9應用大全
- 一學就會:Windows Vista應用完全自學手冊
- INSTANT Galleria Howto
- 寫給架構師的Linux實踐:設計并實現基于Linux的IT解決方案
- 從零開始學安裝與重裝系統
- Multi-Cloud for Architects
- Implementing Cloud Design Patterns for AWS(Second Edition)