CloudFormation
CloudFormation is a service that helps you model and set up your Amazon Web Services resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS. Here is an example of how to create a CloudFormation stack using the AWS SDK for Python (boto3):
python
import boto3
cloudformation = boto3.client('cloudformation')
response = cloudformation.create_stack(
StackName='my-stack',
TemplateBody='''{
"Resources": {
"MyBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "my-bucket"
}
}
}
}'''
)
This code creates a CloudFormation stack called "my-stack" that creates an S3 bucket with the name "my-bucket". The CloudFormation template is provided as a JSON string in the "TemplateBody" parameter.
No comments:
Post a Comment