All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.opsworks.model.CreateStackRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS OpsWorks module holds the client classes that are used for communicating with AWS OpsWorks Service

There is a newer version: 2.28.4
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.opsworks.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateStackRequest extends OpsWorksRequest implements
        ToCopyableBuilder {
    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
            .getter(getter(CreateStackRequest::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();

    private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Region")
            .getter(getter(CreateStackRequest::region)).setter(setter(Builder::region))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build();

    private static final SdkField VPC_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("VpcId")
            .getter(getter(CreateStackRequest::vpcId)).setter(setter(Builder::vpcId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcId").build()).build();

    private static final SdkField> ATTRIBUTES_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("Attributes")
            .getter(getter(CreateStackRequest::attributesAsStrings))
            .setter(setter(Builder::attributesWithStrings))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Attributes").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField SERVICE_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ServiceRoleArn").getter(getter(CreateStackRequest::serviceRoleArn))
            .setter(setter(Builder::serviceRoleArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceRoleArn").build()).build();

    private static final SdkField DEFAULT_INSTANCE_PROFILE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DefaultInstanceProfileArn").getter(getter(CreateStackRequest::defaultInstanceProfileArn))
            .setter(setter(Builder::defaultInstanceProfileArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultInstanceProfileArn").build())
            .build();

    private static final SdkField DEFAULT_OS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DefaultOs").getter(getter(CreateStackRequest::defaultOs)).setter(setter(Builder::defaultOs))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultOs").build()).build();

    private static final SdkField HOSTNAME_THEME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("HostnameTheme").getter(getter(CreateStackRequest::hostnameTheme)).setter(setter(Builder::hostnameTheme))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HostnameTheme").build()).build();

    private static final SdkField DEFAULT_AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DefaultAvailabilityZone").getter(getter(CreateStackRequest::defaultAvailabilityZone))
            .setter(setter(Builder::defaultAvailabilityZone))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultAvailabilityZone").build())
            .build();

    private static final SdkField DEFAULT_SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DefaultSubnetId").getter(getter(CreateStackRequest::defaultSubnetId))
            .setter(setter(Builder::defaultSubnetId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultSubnetId").build()).build();

    private static final SdkField CUSTOM_JSON_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("CustomJson").getter(getter(CreateStackRequest::customJson)).setter(setter(Builder::customJson))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomJson").build()).build();

    private static final SdkField CONFIGURATION_MANAGER_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ConfigurationManager")
            .getter(getter(CreateStackRequest::configurationManager)).setter(setter(Builder::configurationManager))
            .constructor(StackConfigurationManager::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigurationManager").build())
            .build();

    private static final SdkField CHEF_CONFIGURATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ChefConfiguration")
            .getter(getter(CreateStackRequest::chefConfiguration)).setter(setter(Builder::chefConfiguration))
            .constructor(ChefConfiguration::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChefConfiguration").build()).build();

    private static final SdkField USE_CUSTOM_COOKBOOKS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("UseCustomCookbooks").getter(getter(CreateStackRequest::useCustomCookbooks))
            .setter(setter(Builder::useCustomCookbooks))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UseCustomCookbooks").build())
            .build();

    private static final SdkField USE_OPSWORKS_SECURITY_GROUPS_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN).memberName("UseOpsworksSecurityGroups")
            .getter(getter(CreateStackRequest::useOpsworksSecurityGroups)).setter(setter(Builder::useOpsworksSecurityGroups))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UseOpsworksSecurityGroups").build())
            .build();

    private static final SdkField CUSTOM_COOKBOOKS_SOURCE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("CustomCookbooksSource").getter(getter(CreateStackRequest::customCookbooksSource))
            .setter(setter(Builder::customCookbooksSource)).constructor(Source::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomCookbooksSource").build())
            .build();

    private static final SdkField DEFAULT_SSH_KEY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DefaultSshKeyName").getter(getter(CreateStackRequest::defaultSshKeyName))
            .setter(setter(Builder::defaultSshKeyName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultSshKeyName").build()).build();

    private static final SdkField DEFAULT_ROOT_DEVICE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DefaultRootDeviceType").getter(getter(CreateStackRequest::defaultRootDeviceTypeAsString))
            .setter(setter(Builder::defaultRootDeviceType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultRootDeviceType").build())
            .build();

    private static final SdkField AGENT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("AgentVersion").getter(getter(CreateStackRequest::agentVersion)).setter(setter(Builder::agentVersion))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AgentVersion").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, REGION_FIELD,
            VPC_ID_FIELD, ATTRIBUTES_FIELD, SERVICE_ROLE_ARN_FIELD, DEFAULT_INSTANCE_PROFILE_ARN_FIELD, DEFAULT_OS_FIELD,
            HOSTNAME_THEME_FIELD, DEFAULT_AVAILABILITY_ZONE_FIELD, DEFAULT_SUBNET_ID_FIELD, CUSTOM_JSON_FIELD,
            CONFIGURATION_MANAGER_FIELD, CHEF_CONFIGURATION_FIELD, USE_CUSTOM_COOKBOOKS_FIELD,
            USE_OPSWORKS_SECURITY_GROUPS_FIELD, CUSTOM_COOKBOOKS_SOURCE_FIELD, DEFAULT_SSH_KEY_NAME_FIELD,
            DEFAULT_ROOT_DEVICE_TYPE_FIELD, AGENT_VERSION_FIELD));

    private final String name;

    private final String region;

    private final String vpcId;

    private final Map attributes;

    private final String serviceRoleArn;

    private final String defaultInstanceProfileArn;

    private final String defaultOs;

    private final String hostnameTheme;

    private final String defaultAvailabilityZone;

    private final String defaultSubnetId;

    private final String customJson;

    private final StackConfigurationManager configurationManager;

    private final ChefConfiguration chefConfiguration;

    private final Boolean useCustomCookbooks;

    private final Boolean useOpsworksSecurityGroups;

    private final Source customCookbooksSource;

    private final String defaultSshKeyName;

    private final String defaultRootDeviceType;

    private final String agentVersion;

    private CreateStackRequest(BuilderImpl builder) {
        super(builder);
        this.name = builder.name;
        this.region = builder.region;
        this.vpcId = builder.vpcId;
        this.attributes = builder.attributes;
        this.serviceRoleArn = builder.serviceRoleArn;
        this.defaultInstanceProfileArn = builder.defaultInstanceProfileArn;
        this.defaultOs = builder.defaultOs;
        this.hostnameTheme = builder.hostnameTheme;
        this.defaultAvailabilityZone = builder.defaultAvailabilityZone;
        this.defaultSubnetId = builder.defaultSubnetId;
        this.customJson = builder.customJson;
        this.configurationManager = builder.configurationManager;
        this.chefConfiguration = builder.chefConfiguration;
        this.useCustomCookbooks = builder.useCustomCookbooks;
        this.useOpsworksSecurityGroups = builder.useOpsworksSecurityGroups;
        this.customCookbooksSource = builder.customCookbooksSource;
        this.defaultSshKeyName = builder.defaultSshKeyName;
        this.defaultRootDeviceType = builder.defaultRootDeviceType;
        this.agentVersion = builder.agentVersion;
    }

    /**
     * 

* The stack name. Stack names can be a maximum of 64 characters. *

* * @return The stack name. Stack names can be a maximum of 64 characters. */ public final String name() { return name; } /** *

* The stack's Amazon Web Services Region, such as ap-south-1. For more information about Amazon Web * Services Regions, see Regions and * Endpoints. *

* *

* In the CLI, this API maps to the --stack-region parameter. If the --stack-region * parameter and the CLI common parameter --region are set to the same value, the stack uses a * regional endpoint. If the --stack-region parameter is not set, but the CLI * --region parameter is, this also results in a stack with a regional endpoint. However, if the * --region parameter is set to us-east-1, and the --stack-region parameter * is set to one of the following, then the stack uses a legacy or classic region: * us-west-1, us-west-2, sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2 * . In this case, the actual API endpoint of the stack is in us-east-1. Only the preceding regions are * supported as classic regions in the us-east-1 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 --region parameter always specifies a regional API * endpoint; it cannot be used to specify a classic OpsWorks Stacks region. *

*
* * @return The stack's Amazon Web Services Region, such as ap-south-1. For more information about * Amazon Web Services Regions, see Regions and Endpoints.

*

* In the CLI, this API maps to the --stack-region parameter. If the * --stack-region parameter and the CLI common parameter --region are set to the * same value, the stack uses a regional endpoint. If the --stack-region parameter is * not set, but the CLI --region parameter is, this also results in a stack with a * regional endpoint. However, if the --region parameter is set to * us-east-1, and the --stack-region parameter is set to one of the following, * then the stack uses a legacy or classic region: * us-west-1, us-west-2, sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2 * . In this case, the actual API endpoint of the stack is in us-east-1. Only the preceding * regions are supported as classic regions in the us-east-1 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 --region parameter * always specifies a regional API endpoint; it cannot be used to specify a classic OpsWorks Stacks region. *

*/ public final String region() { return region; } /** *

* 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. *

*
    *
  • *

    * If your account supports EC2-Classic, the default value is no VPC. *

    *
  • *
  • *

    * If your account does not support EC2-Classic, the default value is the default VPC for the specified region. *

    *
  • *
*

* If the VPC ID corresponds to a default VPC and you have specified either the DefaultAvailabilityZone * or the DefaultSubnetId 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. *

*

* If you specify a nondefault VPC ID, note the following: *

*
    *
  • *

    * It must belong to a VPC in your account that is in the specified region. *

    *
  • *
  • *

    * You must specify a value for DefaultSubnetId. *

    *
  • *
*

* For more information about how to use OpsWorks Stacks with a VPC, see Running a Stack in a VPC. * For more information about default VPC and EC2-Classic, see Supported Platforms. *

* * @return 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.

*
    *
  • *

    * If your account supports EC2-Classic, the default value is no VPC. *

    *
  • *
  • *

    * If your account does not support EC2-Classic, the default value is the default VPC for the specified * region. *

    *
  • *
*

* If the VPC ID corresponds to a default VPC and you have specified either the * DefaultAvailabilityZone or the DefaultSubnetId 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. *

*

* If you specify a nondefault VPC ID, note the following: *

*
    *
  • *

    * It must belong to a VPC in your account that is in the specified region. *

    *
  • *
  • *

    * You must specify a value for DefaultSubnetId. *

    *
  • *
*

* For more information about how to use OpsWorks Stacks with a VPC, see Running a Stack in a * VPC. For more information about default VPC and EC2-Classic, see Supported * Platforms. */ public final String vpcId() { return vpcId; } /** *

* One or more user-defined key-value pairs to be added to the stack attributes. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAttributes} method. *

* * @return One or more user-defined key-value pairs to be added to the stack attributes. */ public final Map attributes() { return StackAttributesCopier.copyStringToEnum(attributes); } /** * For responses, this returns true if the service returned a value for the Attributes property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasAttributes() { return attributes != null && !(attributes instanceof SdkAutoConstructMap); } /** *

* One or more user-defined key-value pairs to be added to the stack attributes. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAttributes} method. *

* * @return One or more user-defined key-value pairs to be added to the stack attributes. */ public final Map attributesAsStrings() { return attributes; } /** *

* 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 Using * Identifiers. *

* * @return 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 Using Identifiers. */ public final String serviceRoleArn() { return serviceRoleArn; } /** *

* 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 Using Identifiers. *

* * @return 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 Using Identifiers. */ public final String defaultInstanceProfileArn() { return defaultInstanceProfileArn; } /** *

* 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. *

*
    *
  • *

    * A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2, * Amazon Linux 2018.03, Amazon Linux 2017.09, Amazon Linux 2017.03, * Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or * Amazon Linux 2015.03. *

    *
  • *
  • *

    * A supported Ubuntu operating system, such as Ubuntu 18.04 LTS, Ubuntu 16.04 LTS, * Ubuntu 14.04 LTS, or Ubuntu 12.04 LTS. *

    *
  • *
  • *

    * CentOS Linux 7 *

    *
  • *
  • *

    * Red Hat Enterprise Linux 7 *

    *
  • *
  • *

    * A supported Windows operating system, such as Microsoft Windows Server 2012 R2 Base, * Microsoft Windows Server 2012 R2 with SQL Server Express, * Microsoft Windows Server 2012 R2 with SQL Server Standard, or * Microsoft Windows Server 2012 R2 with SQL Server Web. *

    *
  • *
  • *

    * A custom AMI: Custom. You specify the custom AMI you want to use when you create instances. For more * information, see Using Custom * AMIs. *

    *
  • *
*

* 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 OpsWorks Stacks Operating * Systems. *

* * @return 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.

*
    *
  • *

    * A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2, * Amazon Linux 2018.03, Amazon Linux 2017.09, Amazon Linux 2017.03, * Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, * or Amazon Linux 2015.03. *

    *
  • *
  • *

    * A supported Ubuntu operating system, such as Ubuntu 18.04 LTS, Ubuntu 16.04 LTS, Ubuntu 14.04 LTS, or Ubuntu 12.04 LTS. *

    *
  • *
  • *

    * CentOS Linux 7 *

    *
  • *
  • *

    * Red Hat Enterprise Linux 7 *

    *
  • *
  • *

    * A supported Windows operating system, such as Microsoft Windows Server 2012 R2 Base, * Microsoft Windows Server 2012 R2 with SQL Server Express, * Microsoft Windows Server 2012 R2 with SQL Server Standard, or * Microsoft Windows Server 2012 R2 with SQL Server Web. *

    *
  • *
  • *

    * A custom AMI: Custom. You specify the custom AMI you want to use when you create instances. * For more information, see Using * Custom AMIs. *

    *
  • *
*

* 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 OpsWorks Stacks * Operating Systems. */ public final String defaultOs() { return defaultOs; } /** *

* 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, HostnameTheme is set to Layer_Dependent, which * creates host names by appending integers to the layer's short name. The other themes are: *

*
    *
  • *

    * Baked_Goods *

    *
  • *
  • *

    * Clouds *

    *
  • *
  • *

    * Europe_Cities *

    *
  • *
  • *

    * Fruits *

    *
  • *
  • *

    * Greek_Deities_and_Titans *

    *
  • *
  • *

    * Legendary_creatures_from_Japan *

    *
  • *
  • *

    * Planets_and_Moons *

    *
  • *
  • *

    * Roman_Deities *

    *
  • *
  • *

    * Scottish_Islands *

    *
  • *
  • *

    * US_Cities *

    *
  • *
  • *

    * Wild_Cats *

    *
  • *
*

* To obtain a generated host name, call GetHostNameSuggestion, which returns a host name based on the * current theme. *

* * @return 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, HostnameTheme is set to * Layer_Dependent, which creates host names by appending integers to the layer's short name. * The other themes are:

*
    *
  • *

    * Baked_Goods *

    *
  • *
  • *

    * Clouds *

    *
  • *
  • *

    * Europe_Cities *

    *
  • *
  • *

    * Fruits *

    *
  • *
  • *

    * Greek_Deities_and_Titans *

    *
  • *
  • *

    * Legendary_creatures_from_Japan *

    *
  • *
  • *

    * Planets_and_Moons *

    *
  • *
  • *

    * Roman_Deities *

    *
  • *
  • *

    * Scottish_Islands *

    *
  • *
  • *

    * US_Cities *

    *
  • *
  • *

    * Wild_Cats *

    *
  • *
*

* To obtain a generated host name, call GetHostNameSuggestion, which returns a host name based * on the current theme. */ public final String hostnameTheme() { return hostnameTheme; } /** *

* The stack's default Availability Zone, which must be in the specified region. For more information, see Regions and Endpoints. If you also specify a * value for DefaultSubnetId, the subnet must be in the same zone. For more information, see the * VpcId parameter description. *

* * @return The stack's default Availability Zone, which must be in the specified region. For more information, see * Regions and Endpoints. If you also * specify a value for DefaultSubnetId, the subnet must be in the same zone. For more * information, see the VpcId parameter description. */ public final String defaultAvailabilityZone() { return defaultAvailabilityZone; } /** *

* The stack's default VPC subnet ID. This parameter is required if you specify a value for the VpcId * parameter. All instances are launched into this subnet unless you specify otherwise when you create the instance. * If you also specify a value for DefaultAvailabilityZone, the subnet must be in that zone. For * information on default values and when this parameter is required, see the VpcId parameter * description. *

* * @return The stack's default VPC subnet ID. This parameter is required if you specify a value for the * VpcId parameter. All instances are launched into this subnet unless you specify otherwise * when you create the instance. If you also specify a value for DefaultAvailabilityZone, the * subnet must be in that zone. For information on default values and when this parameter is required, see * the VpcId parameter description. */ public final String defaultSubnetId() { return defaultSubnetId; } /** *

* 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: *

*

* "{\"key1\": \"value1\", \"key2\": \"value2\",...}" *

*

* For more information about custom JSON, see Use Custom JSON to Modify * the Stack Configuration Attributes. *

* * @return 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:

*

* "{\"key1\": \"value1\", \"key2\": \"value2\",...}" *

*

* For more information about custom JSON, see Use Custom JSON to * Modify the Stack Configuration Attributes. */ public final String customJson() { return customJson; } /** *

* 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. *

* * @return 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. */ public final StackConfigurationManager configurationManager() { return configurationManager; } /** *

* A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version on * Chef 11.10 stacks. For more information, see Create a New Stack. *

* * @return A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf * version on Chef 11.10 stacks. For more information, see Create a New * Stack. */ public final ChefConfiguration chefConfiguration() { return chefConfiguration; } /** *

* Whether the stack uses custom cookbooks. *

* * @return Whether the stack uses custom cookbooks. */ public final Boolean useCustomCookbooks() { return useCustomCookbooks; } /** *

* Whether to associate the OpsWorks Stacks built-in security groups with the stack's layers. *

*

* OpsWorks Stacks provides a standard set of built-in security groups, one for each layer, which are associated * with layers by default. With UseOpsworksSecurityGroups you can instead provide your own custom * security groups. UseOpsworksSecurityGroups has the following settings: *

*
    *
  • *

    * 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. *

    *
  • *
  • *

    * 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. *

    *
  • *
*

* For more information, see Create a New Stack. *

* * @return Whether to associate the OpsWorks Stacks built-in security groups with the stack's layers.

*

* OpsWorks Stacks provides a standard set of built-in security groups, one for each layer, which are * associated with layers by default. With UseOpsworksSecurityGroups you can instead provide * your own custom security groups. UseOpsworksSecurityGroups has the following settings: *

*
    *
  • *

    * 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. *

    *
  • *
  • *

    * 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. *

    *
  • *
*

* For more information, see Create a New * Stack. */ public final Boolean useOpsworksSecurityGroups() { return useOpsworksSecurityGroups; } /** *

* Contains the information required to retrieve an app or cookbook from a repository. For more information, see Adding Apps or Cookbooks and Recipes. *

* * @return Contains the information required to retrieve an app or cookbook from a repository. For more information, * see Adding * Apps or Cookbooks and * Recipes. */ public final Source customCookbooksSource() { return customCookbooksSource; } /** *

* 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 * Using SSH to Communicate with an Instance and Managing SSH Access. * You can override this setting by specifying a different key pair, or no key pair, when you create an instance. *

* * @return 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 Using SSH to * Communicate with an Instance and Managing SSH * Access. You can override this setting by specifying a different key pair, or no key pair, when you create an * instance. */ public final String defaultSshKeyName() { return defaultSshKeyName; } /** *

* 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 instance-store. For more information, see Storage for * the Root Device. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #defaultRootDeviceType} will return {@link RootDeviceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #defaultRootDeviceTypeAsString}. *

* * @return 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 instance-store. For more * information, see Storage for the Root Device. * @see RootDeviceType */ public final RootDeviceType defaultRootDeviceType() { return RootDeviceType.fromValue(defaultRootDeviceType); } /** *

* 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 instance-store. For more information, see Storage for * the Root Device. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #defaultRootDeviceType} will return {@link RootDeviceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #defaultRootDeviceTypeAsString}. *

* * @return 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 instance-store. For more * information, see Storage for the Root Device. * @see RootDeviceType */ public final String defaultRootDeviceTypeAsString() { return defaultRootDeviceType; } /** *

* The default OpsWorks Stacks agent version. You have the following options: *

*
    *
  • *

    * Auto-update - Set this parameter to LATEST. OpsWorks Stacks automatically installs new agent * versions on the stack's instances as soon as they are available. *

    *
  • *
  • *

    * 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. *

    *
  • *
*

* 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 DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2. *

* *

* You can also specify an agent version when you create or update an instance, which overrides the stack's default * setting. *

*
* * @return The default OpsWorks Stacks agent version. You have the following options:

*
    *
  • *

    * Auto-update - Set this parameter to LATEST. OpsWorks Stacks automatically installs new agent * versions on the stack's instances as soon as they are available. *

    *
  • *
  • *

    * 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. *

    *
  • *
*

* 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 DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2. *

* *

* You can also specify an agent version when you create or update an instance, which overrides the stack's * default setting. *

*/ public final String agentVersion() { return agentVersion; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(region()); hashCode = 31 * hashCode + Objects.hashCode(vpcId()); hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(serviceRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(defaultInstanceProfileArn()); hashCode = 31 * hashCode + Objects.hashCode(defaultOs()); hashCode = 31 * hashCode + Objects.hashCode(hostnameTheme()); hashCode = 31 * hashCode + Objects.hashCode(defaultAvailabilityZone()); hashCode = 31 * hashCode + Objects.hashCode(defaultSubnetId()); hashCode = 31 * hashCode + Objects.hashCode(customJson()); hashCode = 31 * hashCode + Objects.hashCode(configurationManager()); hashCode = 31 * hashCode + Objects.hashCode(chefConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(useCustomCookbooks()); hashCode = 31 * hashCode + Objects.hashCode(useOpsworksSecurityGroups()); hashCode = 31 * hashCode + Objects.hashCode(customCookbooksSource()); hashCode = 31 * hashCode + Objects.hashCode(defaultSshKeyName()); hashCode = 31 * hashCode + Objects.hashCode(defaultRootDeviceTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(agentVersion()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateStackRequest)) { return false; } CreateStackRequest other = (CreateStackRequest) obj; return Objects.equals(name(), other.name()) && Objects.equals(region(), other.region()) && Objects.equals(vpcId(), other.vpcId()) && hasAttributes() == other.hasAttributes() && Objects.equals(attributesAsStrings(), other.attributesAsStrings()) && Objects.equals(serviceRoleArn(), other.serviceRoleArn()) && Objects.equals(defaultInstanceProfileArn(), other.defaultInstanceProfileArn()) && Objects.equals(defaultOs(), other.defaultOs()) && Objects.equals(hostnameTheme(), other.hostnameTheme()) && Objects.equals(defaultAvailabilityZone(), other.defaultAvailabilityZone()) && Objects.equals(defaultSubnetId(), other.defaultSubnetId()) && Objects.equals(customJson(), other.customJson()) && Objects.equals(configurationManager(), other.configurationManager()) && Objects.equals(chefConfiguration(), other.chefConfiguration()) && Objects.equals(useCustomCookbooks(), other.useCustomCookbooks()) && Objects.equals(useOpsworksSecurityGroups(), other.useOpsworksSecurityGroups()) && Objects.equals(customCookbooksSource(), other.customCookbooksSource()) && Objects.equals(defaultSshKeyName(), other.defaultSshKeyName()) && Objects.equals(defaultRootDeviceTypeAsString(), other.defaultRootDeviceTypeAsString()) && Objects.equals(agentVersion(), other.agentVersion()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("CreateStackRequest").add("Name", name()).add("Region", region()).add("VpcId", vpcId()) .add("Attributes", hasAttributes() ? attributesAsStrings() : null).add("ServiceRoleArn", serviceRoleArn()) .add("DefaultInstanceProfileArn", defaultInstanceProfileArn()).add("DefaultOs", defaultOs()) .add("HostnameTheme", hostnameTheme()).add("DefaultAvailabilityZone", defaultAvailabilityZone()) .add("DefaultSubnetId", defaultSubnetId()).add("CustomJson", customJson()) .add("ConfigurationManager", configurationManager()).add("ChefConfiguration", chefConfiguration()) .add("UseCustomCookbooks", useCustomCookbooks()).add("UseOpsworksSecurityGroups", useOpsworksSecurityGroups()) .add("CustomCookbooksSource", customCookbooksSource()).add("DefaultSshKeyName", defaultSshKeyName()) .add("DefaultRootDeviceType", defaultRootDeviceTypeAsString()).add("AgentVersion", agentVersion()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "Region": return Optional.ofNullable(clazz.cast(region())); case "VpcId": return Optional.ofNullable(clazz.cast(vpcId())); case "Attributes": return Optional.ofNullable(clazz.cast(attributesAsStrings())); case "ServiceRoleArn": return Optional.ofNullable(clazz.cast(serviceRoleArn())); case "DefaultInstanceProfileArn": return Optional.ofNullable(clazz.cast(defaultInstanceProfileArn())); case "DefaultOs": return Optional.ofNullable(clazz.cast(defaultOs())); case "HostnameTheme": return Optional.ofNullable(clazz.cast(hostnameTheme())); case "DefaultAvailabilityZone": return Optional.ofNullable(clazz.cast(defaultAvailabilityZone())); case "DefaultSubnetId": return Optional.ofNullable(clazz.cast(defaultSubnetId())); case "CustomJson": return Optional.ofNullable(clazz.cast(customJson())); case "ConfigurationManager": return Optional.ofNullable(clazz.cast(configurationManager())); case "ChefConfiguration": return Optional.ofNullable(clazz.cast(chefConfiguration())); case "UseCustomCookbooks": return Optional.ofNullable(clazz.cast(useCustomCookbooks())); case "UseOpsworksSecurityGroups": return Optional.ofNullable(clazz.cast(useOpsworksSecurityGroups())); case "CustomCookbooksSource": return Optional.ofNullable(clazz.cast(customCookbooksSource())); case "DefaultSshKeyName": return Optional.ofNullable(clazz.cast(defaultSshKeyName())); case "DefaultRootDeviceType": return Optional.ofNullable(clazz.cast(defaultRootDeviceTypeAsString())); case "AgentVersion": return Optional.ofNullable(clazz.cast(agentVersion())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateStackRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends OpsWorksRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The stack name. Stack names can be a maximum of 64 characters. *

* * @param name * The stack name. Stack names can be a maximum of 64 characters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The stack's Amazon Web Services Region, such as ap-south-1. For more information about Amazon * Web Services Regions, see Regions and * Endpoints. *

* *

* In the CLI, this API maps to the --stack-region parameter. If the --stack-region * parameter and the CLI common parameter --region are set to the same value, the stack uses a * regional endpoint. If the --stack-region parameter is not set, but the CLI * --region parameter is, this also results in a stack with a regional endpoint. However, if * the --region parameter is set to us-east-1, and the --stack-region * parameter is set to one of the following, then the stack uses a legacy or classic region: * us-west-1, us-west-2, sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2 * . In this case, the actual API endpoint of the stack is in us-east-1. Only the preceding regions * are supported as classic regions in the us-east-1 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 --region parameter always specifies a * regional API endpoint; it cannot be used to specify a classic OpsWorks Stacks region. *

*
* * @param region * The stack's Amazon Web Services Region, such as ap-south-1. For more information about * Amazon Web Services Regions, see Regions and Endpoints.

*

* In the CLI, this API maps to the --stack-region parameter. If the * --stack-region parameter and the CLI common parameter --region are set to * the same value, the stack uses a regional endpoint. If the --stack-region * parameter is not set, but the CLI --region parameter is, this also results in a stack * with a regional endpoint. However, if the --region parameter is set to * us-east-1, and the --stack-region parameter is set to one of the following, * then the stack uses a legacy or classic region: * us-west-1, us-west-2, sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2 * . In this case, the actual API endpoint of the stack is in us-east-1. Only the preceding * regions are supported as classic regions in the us-east-1 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 --region * parameter always specifies a regional API endpoint; it cannot be used to specify a classic OpsWorks * Stacks region. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder region(String region); /** *

* 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. *

*
    *
  • *

    * If your account supports EC2-Classic, the default value is no VPC. *

    *
  • *
  • *

    * If your account does not support EC2-Classic, the default value is the default VPC for the specified region. *

    *
  • *
*

* If the VPC ID corresponds to a default VPC and you have specified either the * DefaultAvailabilityZone or the DefaultSubnetId 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. *

*

* If you specify a nondefault VPC ID, note the following: *

*
    *
  • *

    * It must belong to a VPC in your account that is in the specified region. *

    *
  • *
  • *

    * You must specify a value for DefaultSubnetId. *

    *
  • *
*

* For more information about how to use OpsWorks Stacks with a VPC, see Running a Stack in a * VPC. For more information about default VPC and EC2-Classic, see Supported * Platforms. *

* * @param vpcId * 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.

*
    *
  • *

    * If your account supports EC2-Classic, the default value is no VPC. *

    *
  • *
  • *

    * If your account does not support EC2-Classic, the default value is the default VPC for the specified * region. *

    *
  • *
*

* If the VPC ID corresponds to a default VPC and you have specified either the * DefaultAvailabilityZone or the DefaultSubnetId 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. *

*

* If you specify a nondefault VPC ID, note the following: *

*
    *
  • *

    * It must belong to a VPC in your account that is in the specified region. *

    *
  • *
  • *

    * You must specify a value for DefaultSubnetId. *

    *
  • *
*

* For more information about how to use OpsWorks Stacks with a VPC, see Running a Stack in * a VPC. For more information about default VPC and EC2-Classic, see Supported * Platforms. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcId(String vpcId); /** *

* One or more user-defined key-value pairs to be added to the stack attributes. *

* * @param attributes * One or more user-defined key-value pairs to be added to the stack attributes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attributesWithStrings(Map attributes); /** *

* One or more user-defined key-value pairs to be added to the stack attributes. *

* * @param attributes * One or more user-defined key-value pairs to be added to the stack attributes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attributes(Map attributes); /** *

* 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 Using * Identifiers. *

* * @param serviceRoleArn * 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 Using Identifiers. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceRoleArn(String serviceRoleArn); /** *

* 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 Using Identifiers. *

* * @param defaultInstanceProfileArn * 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 Using Identifiers. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultInstanceProfileArn(String defaultInstanceProfileArn); /** *

* 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. *

*
    *
  • *

    * A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2, * Amazon Linux 2018.03, Amazon Linux 2017.09, Amazon Linux 2017.03, * Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or * Amazon Linux 2015.03. *

    *
  • *
  • *

    * A supported Ubuntu operating system, such as Ubuntu 18.04 LTS, Ubuntu 16.04 LTS, * Ubuntu 14.04 LTS, or Ubuntu 12.04 LTS. *

    *
  • *
  • *

    * CentOS Linux 7 *

    *
  • *
  • *

    * Red Hat Enterprise Linux 7 *

    *
  • *
  • *

    * A supported Windows operating system, such as Microsoft Windows Server 2012 R2 Base, * Microsoft Windows Server 2012 R2 with SQL Server Express, * Microsoft Windows Server 2012 R2 with SQL Server Standard, or * Microsoft Windows Server 2012 R2 with SQL Server Web. *

    *
  • *
  • *

    * A custom AMI: Custom. You specify the custom AMI you want to use when you create instances. For * more information, see Using Custom * AMIs. *

    *
  • *
*

* 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 OpsWorks Stacks * Operating Systems. *

* * @param defaultOs * 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.

*
    *
  • *

    * A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2, * Amazon Linux 2018.03, Amazon Linux 2017.09, * Amazon Linux 2017.03, Amazon Linux 2016.09, * Amazon Linux 2016.03, Amazon Linux 2015.09, or * Amazon Linux 2015.03. *

    *
  • *
  • *

    * A supported Ubuntu operating system, such as Ubuntu 18.04 LTS, * Ubuntu 16.04 LTS, Ubuntu 14.04 LTS, or Ubuntu 12.04 LTS. *

    *
  • *
  • *

    * CentOS Linux 7 *

    *
  • *
  • *

    * Red Hat Enterprise Linux 7 *

    *
  • *
  • *

    * A supported Windows operating system, such as Microsoft Windows Server 2012 R2 Base, * Microsoft Windows Server 2012 R2 with SQL Server Express, * Microsoft Windows Server 2012 R2 with SQL Server Standard, or * Microsoft Windows Server 2012 R2 with SQL Server Web. *

    *
  • *
  • *

    * A custom AMI: Custom. You specify the custom AMI you want to use when you create * instances. For more information, see Using * Custom AMIs. *

    *
  • *
*

* 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 OpsWorks Stacks * Operating Systems. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultOs(String defaultOs); /** *

* 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, HostnameTheme is set to Layer_Dependent, * which creates host names by appending integers to the layer's short name. The other themes are: *

*
    *
  • *

    * Baked_Goods *

    *
  • *
  • *

    * Clouds *

    *
  • *
  • *

    * Europe_Cities *

    *
  • *
  • *

    * Fruits *

    *
  • *
  • *

    * Greek_Deities_and_Titans *

    *
  • *
  • *

    * Legendary_creatures_from_Japan *

    *
  • *
  • *

    * Planets_and_Moons *

    *
  • *
  • *

    * Roman_Deities *

    *
  • *
  • *

    * Scottish_Islands *

    *
  • *
  • *

    * US_Cities *

    *
  • *
  • *

    * Wild_Cats *

    *
  • *
*

* To obtain a generated host name, call GetHostNameSuggestion, which returns a host name based on * the current theme. *

* * @param hostnameTheme * 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, HostnameTheme is set to * Layer_Dependent, which creates host names by appending integers to the layer's short * name. The other themes are:

*
    *
  • *

    * Baked_Goods *

    *
  • *
  • *

    * Clouds *

    *
  • *
  • *

    * Europe_Cities *

    *
  • *
  • *

    * Fruits *

    *
  • *
  • *

    * Greek_Deities_and_Titans *

    *
  • *
  • *

    * Legendary_creatures_from_Japan *

    *
  • *
  • *

    * Planets_and_Moons *

    *
  • *
  • *

    * Roman_Deities *

    *
  • *
  • *

    * Scottish_Islands *

    *
  • *
  • *

    * US_Cities *

    *
  • *
  • *

    * Wild_Cats *

    *
  • *
*

* To obtain a generated host name, call GetHostNameSuggestion, which returns a host name * based on the current theme. * @return Returns a reference to this object so that method calls can be chained together. */ Builder hostnameTheme(String hostnameTheme); /** *

* The stack's default Availability Zone, which must be in the specified region. For more information, see Regions and Endpoints. If you also * specify a value for DefaultSubnetId, the subnet must be in the same zone. For more information, * see the VpcId parameter description. *

* * @param defaultAvailabilityZone * The stack's default Availability Zone, which must be in the specified region. For more information, * see Regions and Endpoints. If * you also specify a value for DefaultSubnetId, the subnet must be in the same zone. For * more information, see the VpcId parameter description. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultAvailabilityZone(String defaultAvailabilityZone); /** *

* The stack's default VPC subnet ID. This parameter is required if you specify a value for the * VpcId parameter. All instances are launched into this subnet unless you specify otherwise when * you create the instance. If you also specify a value for DefaultAvailabilityZone, the subnet * must be in that zone. For information on default values and when this parameter is required, see the * VpcId parameter description. *

* * @param defaultSubnetId * The stack's default VPC subnet ID. This parameter is required if you specify a value for the * VpcId parameter. All instances are launched into this subnet unless you specify otherwise * when you create the instance. If you also specify a value for DefaultAvailabilityZone, * the subnet must be in that zone. For information on default values and when this parameter is * required, see the VpcId parameter description. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultSubnetId(String defaultSubnetId); /** *

* 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: *

*

* "{\"key1\": \"value1\", \"key2\": \"value2\",...}" *

*

* For more information about custom JSON, see Use Custom JSON to * Modify the Stack Configuration Attributes. *

* * @param customJson * 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:

*

* "{\"key1\": \"value1\", \"key2\": \"value2\",...}" *

*

* For more information about custom JSON, see Use Custom JSON * to Modify the Stack Configuration Attributes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customJson(String customJson); /** *

* 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. *

* * @param configurationManager * 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder configurationManager(StackConfigurationManager configurationManager); /** *

* 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. *

* This is a convenience method that creates an instance of the {@link StackConfigurationManager.Builder} * avoiding the need to create one manually via {@link StackConfigurationManager#builder()}. * *

* When the {@link Consumer} completes, {@link StackConfigurationManager.Builder#build()} is called immediately * and its result is passed to {@link #configurationManager(StackConfigurationManager)}. * * @param configurationManager * a consumer that will call methods on {@link StackConfigurationManager.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #configurationManager(StackConfigurationManager) */ default Builder configurationManager(Consumer configurationManager) { return configurationManager(StackConfigurationManager.builder().applyMutation(configurationManager).build()); } /** *

* A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version * on Chef 11.10 stacks. For more information, see Create a New * Stack. *

* * @param chefConfiguration * A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf * version on Chef 11.10 stacks. For more information, see Create a New * Stack. * @return Returns a reference to this object so that method calls can be chained together. */ Builder chefConfiguration(ChefConfiguration chefConfiguration); /** *

* A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version * on Chef 11.10 stacks. For more information, see Create a New * Stack. *

* This is a convenience method that creates an instance of the {@link ChefConfiguration.Builder} avoiding the * need to create one manually via {@link ChefConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link ChefConfiguration.Builder#build()} is called immediately and its * result is passed to {@link #chefConfiguration(ChefConfiguration)}. * * @param chefConfiguration * a consumer that will call methods on {@link ChefConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #chefConfiguration(ChefConfiguration) */ default Builder chefConfiguration(Consumer chefConfiguration) { return chefConfiguration(ChefConfiguration.builder().applyMutation(chefConfiguration).build()); } /** *

* Whether the stack uses custom cookbooks. *

* * @param useCustomCookbooks * Whether the stack uses custom cookbooks. * @return Returns a reference to this object so that method calls can be chained together. */ Builder useCustomCookbooks(Boolean useCustomCookbooks); /** *

* Whether to associate the OpsWorks Stacks built-in security groups with the stack's layers. *

*

* OpsWorks Stacks provides a standard set of built-in security groups, one for each layer, which are associated * with layers by default. With UseOpsworksSecurityGroups you can instead provide your own custom * security groups. UseOpsworksSecurityGroups has the following settings: *

*
    *
  • *

    * 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. *

    *
  • *
  • *

    * 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. *

    *
  • *
*

* For more information, see Create a New * Stack. *

* * @param useOpsworksSecurityGroups * Whether to associate the OpsWorks Stacks built-in security groups with the stack's layers.

*

* OpsWorks Stacks provides a standard set of built-in security groups, one for each layer, which are * associated with layers by default. With UseOpsworksSecurityGroups you can instead provide * your own custom security groups. UseOpsworksSecurityGroups has the following settings: *

*
    *
  • *

    * 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. *

    *
  • *
  • *

    * 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. *

    *
  • *
*

* For more information, see Create a New * Stack. * @return Returns a reference to this object so that method calls can be chained together. */ Builder useOpsworksSecurityGroups(Boolean useOpsworksSecurityGroups); /** *

* Contains the information required to retrieve an app or cookbook from a repository. For more information, see * Adding Apps or * Cookbooks and * Recipes. *

* * @param customCookbooksSource * Contains the information required to retrieve an app or cookbook from a repository. For more * information, see Adding Apps * or Cookbooks and * Recipes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customCookbooksSource(Source customCookbooksSource); /** *

* Contains the information required to retrieve an app or cookbook from a repository. For more information, see * Adding Apps or * Cookbooks and * Recipes. *

* This is a convenience method that creates an instance of the {@link Source.Builder} avoiding the need to * create one manually via {@link Source#builder()}. * *

* When the {@link Consumer} completes, {@link Source.Builder#build()} is called immediately and its result is * passed to {@link #customCookbooksSource(Source)}. * * @param customCookbooksSource * a consumer that will call methods on {@link Source.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #customCookbooksSource(Source) */ default Builder customCookbooksSource(Consumer customCookbooksSource) { return customCookbooksSource(Source.builder().applyMutation(customCookbooksSource).build()); } /** *

* 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 Using SSH to * Communicate with an Instance and Managing SSH * Access. You can override this setting by specifying a different key pair, or no key pair, when you create an * instance. *

* * @param defaultSshKeyName * 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 Using SSH to * Communicate with an Instance and Managing SSH * Access. You can override this setting by specifying a different key pair, or no key pair, when you * create an * instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultSshKeyName(String defaultSshKeyName); /** *

* 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 instance-store. For more information, see * * Storage for the Root Device. *

* * @param defaultRootDeviceType * 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 instance-store. For more * information, see Storage for the Root Device. * @see RootDeviceType * @return Returns a reference to this object so that method calls can be chained together. * @see RootDeviceType */ Builder defaultRootDeviceType(String defaultRootDeviceType); /** *

* 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 instance-store. For more information, see * * Storage for the Root Device. *

* * @param defaultRootDeviceType * 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 instance-store. For more * information, see Storage for the Root Device. * @see RootDeviceType * @return Returns a reference to this object so that method calls can be chained together. * @see RootDeviceType */ Builder defaultRootDeviceType(RootDeviceType defaultRootDeviceType); /** *

* The default OpsWorks Stacks agent version. You have the following options: *

*
    *
  • *

    * Auto-update - Set this parameter to LATEST. OpsWorks Stacks automatically installs new agent * versions on the stack's instances as soon as they are available. *

    *
  • *
  • *

    * 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. *

    *
  • *
*

* 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 DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2. *

* *

* You can also specify an agent version when you create or update an instance, which overrides the stack's * default setting. *

*
* * @param agentVersion * The default OpsWorks Stacks agent version. You have the following options:

*
    *
  • *

    * Auto-update - Set this parameter to LATEST. OpsWorks Stacks automatically installs new * agent versions on the stack's instances as soon as they are available. *

    *
  • *
  • *

    * 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. *

    *
  • *
*

* 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 DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2. *

* *

* You can also specify an agent version when you create or update an instance, which overrides the * stack's default setting. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder agentVersion(String agentVersion); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends OpsWorksRequest.BuilderImpl implements Builder { private String name; private String region; private String vpcId; private Map attributes = DefaultSdkAutoConstructMap.getInstance(); private String serviceRoleArn; private String defaultInstanceProfileArn; private String defaultOs; private String hostnameTheme; private String defaultAvailabilityZone; private String defaultSubnetId; private String customJson; private StackConfigurationManager configurationManager; private ChefConfiguration chefConfiguration; private Boolean useCustomCookbooks; private Boolean useOpsworksSecurityGroups; private Source customCookbooksSource; private String defaultSshKeyName; private String defaultRootDeviceType; private String agentVersion; private BuilderImpl() { } private BuilderImpl(CreateStackRequest model) { super(model); name(model.name); region(model.region); vpcId(model.vpcId); attributesWithStrings(model.attributes); serviceRoleArn(model.serviceRoleArn); defaultInstanceProfileArn(model.defaultInstanceProfileArn); defaultOs(model.defaultOs); hostnameTheme(model.hostnameTheme); defaultAvailabilityZone(model.defaultAvailabilityZone); defaultSubnetId(model.defaultSubnetId); customJson(model.customJson); configurationManager(model.configurationManager); chefConfiguration(model.chefConfiguration); useCustomCookbooks(model.useCustomCookbooks); useOpsworksSecurityGroups(model.useOpsworksSecurityGroups); customCookbooksSource(model.customCookbooksSource); defaultSshKeyName(model.defaultSshKeyName); defaultRootDeviceType(model.defaultRootDeviceType); agentVersion(model.agentVersion); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getRegion() { return region; } public final void setRegion(String region) { this.region = region; } @Override public final Builder region(String region) { this.region = region; return this; } public final String getVpcId() { return vpcId; } public final void setVpcId(String vpcId) { this.vpcId = vpcId; } @Override public final Builder vpcId(String vpcId) { this.vpcId = vpcId; return this; } public final Map getAttributes() { if (attributes instanceof SdkAutoConstructMap) { return null; } return attributes; } public final void setAttributes(Map attributes) { this.attributes = StackAttributesCopier.copy(attributes); } @Override public final Builder attributesWithStrings(Map attributes) { this.attributes = StackAttributesCopier.copy(attributes); return this; } @Override public final Builder attributes(Map attributes) { this.attributes = StackAttributesCopier.copyEnumToString(attributes); return this; } public final String getServiceRoleArn() { return serviceRoleArn; } public final void setServiceRoleArn(String serviceRoleArn) { this.serviceRoleArn = serviceRoleArn; } @Override public final Builder serviceRoleArn(String serviceRoleArn) { this.serviceRoleArn = serviceRoleArn; return this; } public final String getDefaultInstanceProfileArn() { return defaultInstanceProfileArn; } public final void setDefaultInstanceProfileArn(String defaultInstanceProfileArn) { this.defaultInstanceProfileArn = defaultInstanceProfileArn; } @Override public final Builder defaultInstanceProfileArn(String defaultInstanceProfileArn) { this.defaultInstanceProfileArn = defaultInstanceProfileArn; return this; } public final String getDefaultOs() { return defaultOs; } public final void setDefaultOs(String defaultOs) { this.defaultOs = defaultOs; } @Override public final Builder defaultOs(String defaultOs) { this.defaultOs = defaultOs; return this; } public final String getHostnameTheme() { return hostnameTheme; } public final void setHostnameTheme(String hostnameTheme) { this.hostnameTheme = hostnameTheme; } @Override public final Builder hostnameTheme(String hostnameTheme) { this.hostnameTheme = hostnameTheme; return this; } public final String getDefaultAvailabilityZone() { return defaultAvailabilityZone; } public final void setDefaultAvailabilityZone(String defaultAvailabilityZone) { this.defaultAvailabilityZone = defaultAvailabilityZone; } @Override public final Builder defaultAvailabilityZone(String defaultAvailabilityZone) { this.defaultAvailabilityZone = defaultAvailabilityZone; return this; } public final String getDefaultSubnetId() { return defaultSubnetId; } public final void setDefaultSubnetId(String defaultSubnetId) { this.defaultSubnetId = defaultSubnetId; } @Override public final Builder defaultSubnetId(String defaultSubnetId) { this.defaultSubnetId = defaultSubnetId; return this; } public final String getCustomJson() { return customJson; } public final void setCustomJson(String customJson) { this.customJson = customJson; } @Override public final Builder customJson(String customJson) { this.customJson = customJson; return this; } public final StackConfigurationManager.Builder getConfigurationManager() { return configurationManager != null ? configurationManager.toBuilder() : null; } public final void setConfigurationManager(StackConfigurationManager.BuilderImpl configurationManager) { this.configurationManager = configurationManager != null ? configurationManager.build() : null; } @Override public final Builder configurationManager(StackConfigurationManager configurationManager) { this.configurationManager = configurationManager; return this; } public final ChefConfiguration.Builder getChefConfiguration() { return chefConfiguration != null ? chefConfiguration.toBuilder() : null; } public final void setChefConfiguration(ChefConfiguration.BuilderImpl chefConfiguration) { this.chefConfiguration = chefConfiguration != null ? chefConfiguration.build() : null; } @Override public final Builder chefConfiguration(ChefConfiguration chefConfiguration) { this.chefConfiguration = chefConfiguration; return this; } public final Boolean getUseCustomCookbooks() { return useCustomCookbooks; } public final void setUseCustomCookbooks(Boolean useCustomCookbooks) { this.useCustomCookbooks = useCustomCookbooks; } @Override public final Builder useCustomCookbooks(Boolean useCustomCookbooks) { this.useCustomCookbooks = useCustomCookbooks; return this; } public final Boolean getUseOpsworksSecurityGroups() { return useOpsworksSecurityGroups; } public final void setUseOpsworksSecurityGroups(Boolean useOpsworksSecurityGroups) { this.useOpsworksSecurityGroups = useOpsworksSecurityGroups; } @Override public final Builder useOpsworksSecurityGroups(Boolean useOpsworksSecurityGroups) { this.useOpsworksSecurityGroups = useOpsworksSecurityGroups; return this; } public final Source.Builder getCustomCookbooksSource() { return customCookbooksSource != null ? customCookbooksSource.toBuilder() : null; } public final void setCustomCookbooksSource(Source.BuilderImpl customCookbooksSource) { this.customCookbooksSource = customCookbooksSource != null ? customCookbooksSource.build() : null; } @Override public final Builder customCookbooksSource(Source customCookbooksSource) { this.customCookbooksSource = customCookbooksSource; return this; } public final String getDefaultSshKeyName() { return defaultSshKeyName; } public final void setDefaultSshKeyName(String defaultSshKeyName) { this.defaultSshKeyName = defaultSshKeyName; } @Override public final Builder defaultSshKeyName(String defaultSshKeyName) { this.defaultSshKeyName = defaultSshKeyName; return this; } public final String getDefaultRootDeviceType() { return defaultRootDeviceType; } public final void setDefaultRootDeviceType(String defaultRootDeviceType) { this.defaultRootDeviceType = defaultRootDeviceType; } @Override public final Builder defaultRootDeviceType(String defaultRootDeviceType) { this.defaultRootDeviceType = defaultRootDeviceType; return this; } @Override public final Builder defaultRootDeviceType(RootDeviceType defaultRootDeviceType) { this.defaultRootDeviceType(defaultRootDeviceType == null ? null : defaultRootDeviceType.toString()); return this; } public final String getAgentVersion() { return agentVersion; } public final void setAgentVersion(String agentVersion) { this.agentVersion = agentVersion; } @Override public final Builder agentVersion(String agentVersion) { this.agentVersion = agentVersion; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateStackRequest build() { return new CreateStackRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy