MCPcopy Create free account
hub / github.com/awslabs/staticwebsite-cli / create_stack

Function create_stack

src/cloudformation_helpers.rs:130–157  ·  view source on GitHub ↗

Creates the static website stack. This function returns once the CreateStack call has been made to the API, but does not wait for the stack to settle into a Complete state.

(
    stack_name: &String,
    cfn_client: &aws_sdk_cloudformation::Client,
    stack_body: &String,
    zone_id: &String,
    domain_name: &String,
)

Source from the content-addressed store, hash-verified

128/// but does not wait for the stack to settle into a Complete state.
129///
130pub async fn create_stack(
131 stack_name: &String,
132 cfn_client: &aws_sdk_cloudformation::Client,
133 stack_body: &String,
134 zone_id: &String,
135 domain_name: &String,
136) -> Result<String, SdkError<CreateStackError>> {
137 let create_stack_response = cfn_client
138 .create_stack()
139 .stack_name(stack_name)
140 .template_body(stack_body)
141 .parameters(
142 Parameter::builder()
143 .parameter_key("HostedZoneId")
144 .parameter_value(zone_id)
145 .build(),
146 )
147 .parameters(
148 Parameter::builder()
149 .parameter_key("DomainName")
150 .parameter_value(domain_name)
151 .build(),
152 )
153 .send()
154 .await?;
155
156 Ok(create_stack_response.stack_id().unwrap().to_string())
157}
158
159///
160/// Updates the stack. This function returns once the UpdateStack call has been made to the API,

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected