You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
801 B
35 lines
801 B
import time
|
|
|
|
import boto3
|
|
from botocore.exceptions import ClientError
|
|
|
|
region = 'eu-central-1'
|
|
stackName = 'cloudcomp-counter-demo-stack'
|
|
keyName = 'srieger-pub'
|
|
|
|
|
|
client = boto3.setup_default_session(region_name=region)
|
|
cfClient = boto3.client('cloudformation')
|
|
|
|
templateFile = open("cloudcomp-counter-demo-with-vpc.json", "r")
|
|
templateBody = templateFile.read()
|
|
|
|
print("Deleting old stack...")
|
|
print("------------------------------------")
|
|
response = cfClient.delete_stack(
|
|
StackName=stackName,
|
|
)
|
|
|
|
print("creating new stack...")
|
|
print("------------------------------------")
|
|
|
|
response = cfClient.create_stack(
|
|
StackName=stackName,
|
|
TemplateBody=templateBody,
|
|
Parameters=[
|
|
{
|
|
'ParameterKey': 'paramKeyPair',
|
|
'ParameterValue': keyName
|
|
},
|
|
],
|
|
)
|