You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"Post build stage failed. The stack {stack_name} is in an unexpected status: {stack_status}. Please visit the AWS CloudFormation Console to delete the stack."
print(f"Stack {stack_name} already exists. Proceeding with update.")
48
-
withopen(template_path, "r") astemplate_file:
49
-
template_body=template_file.read()
50
-
51
-
try:
52
-
response=client.update_stack(
53
-
StackName=stack_name,
54
-
TemplateBody=template_body,
55
-
Capabilities=["CAPABILITY_NAMED_IAM"],
56
-
Parameters=parameters
57
-
)
58
-
exceptExceptionase:
59
-
print(f"No updates are to be performed for stack {stack_name}.")
60
-
61
-
print(f"Started update of stack {stack_name}")
62
-
wait_for_stack_completion(client, stack_name)
63
-
64
-
exceptclient.exceptions.ClientErrorase:
65
-
if"does not exist"instr(e):
66
-
print(f"Stack {stack_name} does not exist. Proceeding with creation.")
67
-
withopen(template_path, "r") astemplate_file:
68
-
template_body=template_file.read()
69
-
70
-
response=client.create_stack(
71
-
StackName=stack_name,
72
-
TemplateBody=template_body,
73
-
Capabilities=["CAPABILITY_NAMED_IAM"],
74
-
Parameters=parameters,
75
-
EnableTerminationProtection=True,
76
-
)
77
-
78
-
stack_id=response["StackId"]
79
-
print(f"Started deployment of stack {stack_name} with ID {stack_id}")
80
-
wait_for_stack_completion(client, stack_name)
81
-
else:
82
-
print(
83
-
f"Post build stage failed. The stack {stack_name} is in an unexpected status: {stack_status}. Please visit the AWS CloudFormation Console to delete the stack."
Description: The DNS name of the public load balancer. To use HTTPS, create an SSL certificate in AWS Certificate Manager and attach it to the load balancer.
0 commit comments