aws_sdk_opsworks/client/
create_stack.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreateStack`](crate::operation::create_stack::builders::CreateStackFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`name(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_name):<br>required: **true**<br><p>The stack name. Stack names can be a maximum of 64 characters.</p><br>
7    ///   - [`region(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::region) / [`set_region(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_region):<br>required: **true**<br><p>The stack's Amazon Web Services Region, such as <code>ap-south-1</code>. For more information about Amazon Web Services Regions, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html">Regions and Endpoints</a>.</p><note>  <p>In the CLI, this API maps to the <code>--stack-region</code> parameter. If the <code>--stack-region</code> parameter and the CLI common parameter <code>--region</code> are set to the same value, the stack uses a <i>regional</i> endpoint. If the <code>--stack-region</code> parameter is not set, but the CLI <code>--region</code> parameter is, this also results in a stack with a <i>regional</i> endpoint. However, if the <code>--region</code> parameter is set to <code>us-east-1</code>, and the <code>--stack-region</code> parameter is set to one of the following, then the stack uses a legacy or <i>classic</i> region: <code>us-west-1, us-west-2, sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2</code>. In this case, the actual API endpoint of the stack is in <code>us-east-1</code>. Only the preceding regions are supported as classic regions in the <code>us-east-1</code> API endpoint. Because it is a best practice to choose the regional endpoint that is closest to where you manage Amazon Web Services, we recommend that you use regional endpoints for new stacks. The CLI common <code>--region</code> parameter always specifies a regional API endpoint; it cannot be used to specify a classic OpsWorks Stacks region.</p> </note><br>
8    ///   - [`vpc_id(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::vpc_id) / [`set_vpc_id(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_vpc_id):<br>required: **false**<br><p>The ID of the VPC that the stack is to be launched into. The VPC must be in the stack's region. All instances are launched into this VPC. You cannot change the ID later.</p> <ul>  <li>   <p>If your account supports EC2-Classic, the default value is <code>no VPC</code>.</p></li>  <li>   <p>If your account does not support EC2-Classic, the default value is the default VPC for the specified region.</p></li> </ul> <p>If the VPC ID corresponds to a default VPC and you have specified either the <code>DefaultAvailabilityZone</code> or the <code>DefaultSubnetId</code> parameter only, OpsWorks Stacks infers the value of the other parameter. If you specify neither parameter, OpsWorks Stacks sets these parameters to the first valid Availability Zone for the specified region and the corresponding default VPC subnet ID, respectively.</p> <p>If you specify a nondefault VPC ID, note the following:</p> <ul>  <li>   <p>It must belong to a VPC in your account that is in the specified region.</p></li>  <li>   <p>You must specify a value for <code>DefaultSubnetId</code>.</p></li> </ul> <p>For more information about how to use OpsWorks Stacks with a VPC, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html">Running a Stack in a VPC</a>. For more information about default VPC and EC2-Classic, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html">Supported Platforms</a>.</p><br>
9    ///   - [`attributes(StackAttributesKeys, impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::attributes) / [`set_attributes(Option<HashMap::<StackAttributesKeys, String>>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_attributes):<br>required: **false**<br><p>One or more user-defined key-value pairs to be added to the stack attributes.</p><br>
10    ///   - [`service_role_arn(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::service_role_arn) / [`set_service_role_arn(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_service_role_arn):<br>required: **true**<br><p>The stack's IAM role, which allows OpsWorks Stacks to work with Amazon Web Services resources on your behalf. You must set this parameter to the Amazon Resource Name (ARN) for an existing IAM role. For more information about IAM ARNs, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">Using Identifiers</a>.</p><br>
11    ///   - [`default_instance_profile_arn(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::default_instance_profile_arn) / [`set_default_instance_profile_arn(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_default_instance_profile_arn):<br>required: **true**<br><p>The Amazon Resource Name (ARN) of an IAM profile that is the default profile for all of the stack's EC2 instances. For more information about IAM ARNs, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">Using Identifiers</a>.</p><br>
12    ///   - [`default_os(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::default_os) / [`set_default_os(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_default_os):<br>required: **false**<br><p>The stack's default operating system, which is installed on every instance unless you specify a different operating system when you create the instance. You can specify one of the following.</p> <ul>  <li>   <p>A supported Linux operating system: An Amazon Linux version, such as <code>Amazon Linux 2</code>, <code>Amazon Linux 2018.03</code>, <code>Amazon Linux 2017.09</code>, <code>Amazon Linux 2017.03</code>, <code>Amazon Linux 2016.09</code>, <code>Amazon Linux 2016.03</code>, <code>Amazon Linux 2015.09</code>, or <code>Amazon Linux 2015.03</code>.</p></li>  <li>   <p>A supported Ubuntu operating system, such as <code>Ubuntu 18.04 LTS</code>, <code>Ubuntu 16.04 LTS</code>, <code>Ubuntu 14.04 LTS</code>, or <code>Ubuntu 12.04 LTS</code>.</p></li>  <li>   <p><code>CentOS Linux 7</code></p></li>  <li>   <p><code>Red Hat Enterprise Linux 7</code></p></li>  <li>   <p>A supported Windows operating system, such as <code>Microsoft Windows Server 2012 R2 Base</code>, <code>Microsoft Windows Server 2012 R2 with SQL Server Express</code>, <code>Microsoft Windows Server 2012 R2 with SQL Server Standard</code>, or <code>Microsoft Windows Server 2012 R2 with SQL Server Web</code>.</p></li>  <li>   <p>A custom AMI: <code>Custom</code>. You specify the custom AMI you want to use when you create instances. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html"> Using Custom AMIs</a>.</p></li> </ul> <p>The default option is the current Amazon Linux version. Not all operating systems are supported with all versions of Chef. For more information about supported operating systems, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html">OpsWorks Stacks Operating Systems</a>.</p><br>
13    ///   - [`hostname_theme(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::hostname_theme) / [`set_hostname_theme(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_hostname_theme):<br>required: **false**<br><p>The stack's host name theme, with spaces replaced by underscores. The theme is used to generate host names for the stack's instances. By default, <code>HostnameTheme</code> is set to <code>Layer_Dependent</code>, which creates host names by appending integers to the layer's short name. The other themes are:</p> <ul>  <li>   <p><code>Baked_Goods</code></p></li>  <li>   <p><code>Clouds</code></p></li>  <li>   <p><code>Europe_Cities</code></p></li>  <li>   <p><code>Fruits</code></p></li>  <li>   <p><code>Greek_Deities_and_Titans</code></p></li>  <li>   <p><code>Legendary_creatures_from_Japan</code></p></li>  <li>   <p><code>Planets_and_Moons</code></p></li>  <li>   <p><code>Roman_Deities</code></p></li>  <li>   <p><code>Scottish_Islands</code></p></li>  <li>   <p><code>US_Cities</code></p></li>  <li>   <p><code>Wild_Cats</code></p></li> </ul> <p>To obtain a generated host name, call <code>GetHostNameSuggestion</code>, which returns a host name based on the current theme.</p><br>
14    ///   - [`default_availability_zone(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::default_availability_zone) / [`set_default_availability_zone(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_default_availability_zone):<br>required: **false**<br><p>The stack's default Availability Zone, which must be in the specified region. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html">Regions and Endpoints</a>. If you also specify a value for <code>DefaultSubnetId</code>, the subnet must be in the same zone. For more information, see the <code>VpcId</code> parameter description.</p><br>
15    ///   - [`default_subnet_id(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::default_subnet_id) / [`set_default_subnet_id(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_default_subnet_id):<br>required: **false**<br><p>The stack's default VPC subnet ID. This parameter is required if you specify a value for the <code>VpcId</code> parameter. All instances are launched into this subnet unless you specify otherwise when you create the instance. If you also specify a value for <code>DefaultAvailabilityZone</code>, the subnet must be in that zone. For information on default values and when this parameter is required, see the <code>VpcId</code> parameter description.</p><br>
16    ///   - [`custom_json(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::custom_json) / [`set_custom_json(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_custom_json):<br>required: **false**<br><p>A string that contains user-defined, custom JSON. It can be used to override the corresponding default stack configuration attribute values or to pass data to recipes. The string should be in the following format:</p> <p><code>"{\"key1\": \"value1\", \"key2\": \"value2\",...}"</code></p> <p>For more information about custom JSON, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html">Use Custom JSON to Modify the Stack Configuration Attributes</a>.</p><br>
17    ///   - [`configuration_manager(StackConfigurationManager)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::configuration_manager) / [`set_configuration_manager(Option<StackConfigurationManager>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_configuration_manager):<br>required: **false**<br><p>The configuration manager. When you create a stack we recommend that you use the configuration manager to specify the Chef version: 12, 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default value for Linux stacks is currently 12.</p><br>
18    ///   - [`chef_configuration(ChefConfiguration)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::chef_configuration) / [`set_chef_configuration(Option<ChefConfiguration>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_chef_configuration):<br>required: **false**<br><p>A <code>ChefConfiguration</code> object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html">Create a New Stack</a>.</p><br>
19    ///   - [`use_custom_cookbooks(bool)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::use_custom_cookbooks) / [`set_use_custom_cookbooks(Option<bool>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_use_custom_cookbooks):<br>required: **false**<br><p>Whether the stack uses custom cookbooks.</p><br>
20    ///   - [`use_opsworks_security_groups(bool)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::use_opsworks_security_groups) / [`set_use_opsworks_security_groups(Option<bool>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_use_opsworks_security_groups):<br>required: **false**<br><p>Whether to associate the OpsWorks Stacks built-in security groups with the stack's layers.</p> <p>OpsWorks Stacks provides a standard set of built-in security groups, one for each layer, which are associated with layers by default. With <code>UseOpsworksSecurityGroups</code> you can instead provide your own custom security groups. <code>UseOpsworksSecurityGroups</code> has the following settings:</p> <ul>  <li>   <p>True - OpsWorks Stacks automatically associates the appropriate built-in security group with each layer (default setting). You can associate additional security groups with a layer after you create it, but you cannot delete the built-in security group.</p></li>  <li>   <p>False - OpsWorks Stacks does not associate built-in security groups with layers. You must create appropriate EC2 security groups and associate a security group with each layer that you create. However, you can still manually associate a built-in security group with a layer on creation; custom security groups are required only for those layers that need custom settings.</p></li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html">Create a New Stack</a>.</p><br>
21    ///   - [`custom_cookbooks_source(Source)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::custom_cookbooks_source) / [`set_custom_cookbooks_source(Option<Source>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_custom_cookbooks_source):<br>required: **false**<br><p>Contains the information required to retrieve an app or cookbook from a repository. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html">Adding Apps</a> or <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html">Cookbooks and Recipes</a>.</p><br>
22    ///   - [`default_ssh_key_name(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::default_ssh_key_name) / [`set_default_ssh_key_name(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_default_ssh_key_name):<br>required: **false**<br><p>A default Amazon EC2 key pair name. The default value is none. If you specify a key pair name, OpsWorks installs the public key on the instance and you can use the private key with an SSH client to log in to the instance. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html"> Using SSH to Communicate with an Instance</a> and <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html"> Managing SSH Access</a>. You can override this setting by specifying a different key pair, or no key pair, when you <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html"> create an instance</a>.</p><br>
23    ///   - [`default_root_device_type(RootDeviceType)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::default_root_device_type) / [`set_default_root_device_type(Option<RootDeviceType>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_default_root_device_type):<br>required: **false**<br><p>The default root device type. This value is the default for all instances in the stack, but you can override it when you create an instance. The default option is <code>instance-store</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device">Storage for the Root Device</a>.</p><br>
24    ///   - [`agent_version(impl Into<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::agent_version) / [`set_agent_version(Option<String>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_agent_version):<br>required: **false**<br><p>The default OpsWorks Stacks agent version. You have the following options:</p> <ul>  <li>   <p>Auto-update - Set this parameter to <code>LATEST</code>. OpsWorks Stacks automatically installs new agent versions on the stack's instances as soon as they are available.</p></li>  <li>   <p>Fixed version - Set this parameter to your preferred agent version. To update the agent version, you must edit the stack configuration and specify a new version. OpsWorks Stacks installs that version on the stack's instances.</p></li> </ul> <p>The default setting is the most recent release of the agent. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call <code>DescribeAgentVersions</code>. AgentVersion cannot be set to Chef 12.2.</p><note>  <p>You can also specify an agent version when you create or update an instance, which overrides the stack's default setting.</p> </note><br>
25    /// - On success, responds with [`CreateStackOutput`](crate::operation::create_stack::CreateStackOutput) with field(s):
26    ///   - [`stack_id(Option<String>)`](crate::operation::create_stack::CreateStackOutput::stack_id): <p>The stack ID, which is an opaque string that you use to identify the stack when performing actions such as <code>DescribeStacks</code>.</p>
27    /// - On failure, responds with [`SdkError<CreateStackError>`](crate::operation::create_stack::CreateStackError)
28    pub fn create_stack(&self) -> crate::operation::create_stack::builders::CreateStackFluentBuilder {
29        crate::operation::create_stack::builders::CreateStackFluentBuilder::new(self.handle.clone())
30    }
31}