Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.opsworks.model.Layer 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
/*
* 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.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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;
/**
*
* Describes a layer.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Layer implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
.getter(getter(Layer::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();
private static final SdkField STACK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackId").getter(getter(Layer::stackId)).setter(setter(Builder::stackId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackId").build()).build();
private static final SdkField LAYER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LayerId").getter(getter(Layer::layerId)).setter(setter(Builder::layerId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LayerId").build()).build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
.getter(getter(Layer::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(Layer::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField SHORTNAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Shortname").getter(getter(Layer::shortname)).setter(setter(Builder::shortname))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Shortname").build()).build();
private static final SdkField> ATTRIBUTES_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Attributes")
.getter(getter(Layer::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 CLOUD_WATCH_LOGS_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("CloudWatchLogsConfiguration")
.getter(getter(Layer::cloudWatchLogsConfiguration))
.setter(setter(Builder::cloudWatchLogsConfiguration))
.constructor(CloudWatchLogsConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchLogsConfiguration")
.build()).build();
private static final SdkField CUSTOM_INSTANCE_PROFILE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CustomInstanceProfileArn").getter(getter(Layer::customInstanceProfileArn))
.setter(setter(Builder::customInstanceProfileArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomInstanceProfileArn").build())
.build();
private static final SdkField CUSTOM_JSON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CustomJson").getter(getter(Layer::customJson)).setter(setter(Builder::customJson))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomJson").build()).build();
private static final SdkField> CUSTOM_SECURITY_GROUP_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("CustomSecurityGroupIds")
.getter(getter(Layer::customSecurityGroupIds))
.setter(setter(Builder::customSecurityGroupIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomSecurityGroupIds").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> DEFAULT_SECURITY_GROUP_NAMES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("DefaultSecurityGroupNames")
.getter(getter(Layer::defaultSecurityGroupNames))
.setter(setter(Builder::defaultSecurityGroupNames))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultSecurityGroupNames").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> PACKAGES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Packages")
.getter(getter(Layer::packages))
.setter(setter(Builder::packages))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Packages").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> VOLUME_CONFIGURATIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("VolumeConfigurations")
.getter(getter(Layer::volumeConfigurations))
.setter(setter(Builder::volumeConfigurations))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeConfigurations").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(VolumeConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField ENABLE_AUTO_HEALING_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("EnableAutoHealing").getter(getter(Layer::enableAutoHealing)).setter(setter(Builder::enableAutoHealing))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableAutoHealing").build()).build();
private static final SdkField AUTO_ASSIGN_ELASTIC_IPS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AutoAssignElasticIps").getter(getter(Layer::autoAssignElasticIps))
.setter(setter(Builder::autoAssignElasticIps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoAssignElasticIps").build())
.build();
private static final SdkField AUTO_ASSIGN_PUBLIC_IPS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AutoAssignPublicIps").getter(getter(Layer::autoAssignPublicIps))
.setter(setter(Builder::autoAssignPublicIps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoAssignPublicIps").build())
.build();
private static final SdkField DEFAULT_RECIPES_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("DefaultRecipes").getter(getter(Layer::defaultRecipes)).setter(setter(Builder::defaultRecipes))
.constructor(Recipes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultRecipes").build()).build();
private static final SdkField CUSTOM_RECIPES_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("CustomRecipes").getter(getter(Layer::customRecipes)).setter(setter(Builder::customRecipes))
.constructor(Recipes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomRecipes").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CreatedAt").getter(getter(Layer::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build()).build();
private static final SdkField INSTALL_UPDATES_ON_BOOT_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("InstallUpdatesOnBoot").getter(getter(Layer::installUpdatesOnBoot))
.setter(setter(Builder::installUpdatesOnBoot))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstallUpdatesOnBoot").build())
.build();
private static final SdkField USE_EBS_OPTIMIZED_INSTANCES_FIELD = SdkField
. builder(MarshallingType.BOOLEAN).memberName("UseEbsOptimizedInstances")
.getter(getter(Layer::useEbsOptimizedInstances)).setter(setter(Builder::useEbsOptimizedInstances))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UseEbsOptimizedInstances").build())
.build();
private static final SdkField LIFECYCLE_EVENT_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("LifecycleEventConfiguration")
.getter(getter(Layer::lifecycleEventConfiguration))
.setter(setter(Builder::lifecycleEventConfiguration))
.constructor(LifecycleEventConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LifecycleEventConfiguration")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, STACK_ID_FIELD,
LAYER_ID_FIELD, TYPE_FIELD, NAME_FIELD, SHORTNAME_FIELD, ATTRIBUTES_FIELD, CLOUD_WATCH_LOGS_CONFIGURATION_FIELD,
CUSTOM_INSTANCE_PROFILE_ARN_FIELD, CUSTOM_JSON_FIELD, CUSTOM_SECURITY_GROUP_IDS_FIELD,
DEFAULT_SECURITY_GROUP_NAMES_FIELD, PACKAGES_FIELD, VOLUME_CONFIGURATIONS_FIELD, ENABLE_AUTO_HEALING_FIELD,
AUTO_ASSIGN_ELASTIC_IPS_FIELD, AUTO_ASSIGN_PUBLIC_IPS_FIELD, DEFAULT_RECIPES_FIELD, CUSTOM_RECIPES_FIELD,
CREATED_AT_FIELD, INSTALL_UPDATES_ON_BOOT_FIELD, USE_EBS_OPTIMIZED_INSTANCES_FIELD,
LIFECYCLE_EVENT_CONFIGURATION_FIELD));
private static final long serialVersionUID = 1L;
private final String arn;
private final String stackId;
private final String layerId;
private final String type;
private final String name;
private final String shortname;
private final Map attributes;
private final CloudWatchLogsConfiguration cloudWatchLogsConfiguration;
private final String customInstanceProfileArn;
private final String customJson;
private final List customSecurityGroupIds;
private final List defaultSecurityGroupNames;
private final List packages;
private final List volumeConfigurations;
private final Boolean enableAutoHealing;
private final Boolean autoAssignElasticIps;
private final Boolean autoAssignPublicIps;
private final Recipes defaultRecipes;
private final Recipes customRecipes;
private final String createdAt;
private final Boolean installUpdatesOnBoot;
private final Boolean useEbsOptimizedInstances;
private final LifecycleEventConfiguration lifecycleEventConfiguration;
private Layer(BuilderImpl builder) {
this.arn = builder.arn;
this.stackId = builder.stackId;
this.layerId = builder.layerId;
this.type = builder.type;
this.name = builder.name;
this.shortname = builder.shortname;
this.attributes = builder.attributes;
this.cloudWatchLogsConfiguration = builder.cloudWatchLogsConfiguration;
this.customInstanceProfileArn = builder.customInstanceProfileArn;
this.customJson = builder.customJson;
this.customSecurityGroupIds = builder.customSecurityGroupIds;
this.defaultSecurityGroupNames = builder.defaultSecurityGroupNames;
this.packages = builder.packages;
this.volumeConfigurations = builder.volumeConfigurations;
this.enableAutoHealing = builder.enableAutoHealing;
this.autoAssignElasticIps = builder.autoAssignElasticIps;
this.autoAssignPublicIps = builder.autoAssignPublicIps;
this.defaultRecipes = builder.defaultRecipes;
this.customRecipes = builder.customRecipes;
this.createdAt = builder.createdAt;
this.installUpdatesOnBoot = builder.installUpdatesOnBoot;
this.useEbsOptimizedInstances = builder.useEbsOptimizedInstances;
this.lifecycleEventConfiguration = builder.lifecycleEventConfiguration;
}
/**
*
* The Amazon Resource Number (ARN) of a layer.
*
*
* @return The Amazon Resource Number (ARN) of a layer.
*/
public final String arn() {
return arn;
}
/**
*
* The layer stack ID.
*
*
* @return The layer stack ID.
*/
public final String stackId() {
return stackId;
}
/**
*
* The layer ID.
*
*
* @return The layer ID.
*/
public final String layerId() {
return layerId;
}
/**
*
* The layer type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link LayerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The layer type.
* @see LayerType
*/
public final LayerType type() {
return LayerType.fromValue(type);
}
/**
*
* The layer type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link LayerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The layer type.
* @see LayerType
*/
public final String typeAsString() {
return type;
}
/**
*
* The layer name.
*
*
* @return The layer name.
*/
public final String name() {
return name;
}
/**
*
* The layer short name.
*
*
* @return The layer short name.
*/
public final String shortname() {
return shortname;
}
/**
*
* The layer attributes.
*
*
* For the HaproxyStatsPassword
, MysqlRootPassword
, and GangliaPassword
* attributes, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value
*
*
* For an ECS Cluster layer, AWS OpsWorks Stacks the EcsClusterArn
attribute is set to the cluster's
* ARN.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasAttributes()} to see if a value was sent in this field.
*
*
* @return The layer attributes.
*
* For the HaproxyStatsPassword
, MysqlRootPassword
, and
* GangliaPassword
attributes, AWS OpsWorks Stacks returns *****FILTERED*****
* instead of the actual value
*
*
* For an ECS Cluster layer, AWS OpsWorks Stacks the EcsClusterArn
attribute is set to the
* cluster's ARN.
*/
public final Map attributes() {
return LayerAttributesCopier.copyStringToEnum(attributes);
}
/**
* Returns true if the Attributes property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasAttributes() {
return attributes != null && !(attributes instanceof SdkAutoConstructMap);
}
/**
*
* The layer attributes.
*
*
* For the HaproxyStatsPassword
, MysqlRootPassword
, and GangliaPassword
* attributes, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value
*
*
* For an ECS Cluster layer, AWS OpsWorks Stacks the EcsClusterArn
attribute is set to the cluster's
* ARN.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasAttributes()} to see if a value was sent in this field.
*
*
* @return The layer attributes.
*
* For the HaproxyStatsPassword
, MysqlRootPassword
, and
* GangliaPassword
attributes, AWS OpsWorks Stacks returns *****FILTERED*****
* instead of the actual value
*
*
* For an ECS Cluster layer, AWS OpsWorks Stacks the EcsClusterArn
attribute is set to the
* cluster's ARN.
*/
public final Map attributesAsStrings() {
return attributes;
}
/**
*
* The Amazon CloudWatch Logs configuration settings for the layer.
*
*
* @return The Amazon CloudWatch Logs configuration settings for the layer.
*/
public final CloudWatchLogsConfiguration cloudWatchLogsConfiguration() {
return cloudWatchLogsConfiguration;
}
/**
*
* The ARN of the default IAM profile to be used for the layer's EC2 instances. For more information about IAM ARNs,
* see Using Identifiers .
*
*
* @return The ARN of the default IAM profile to be used for the layer's EC2 instances. For more information about
* IAM ARNs, see Using
* Identifiers .
*/
public final String customInstanceProfileArn() {
return customInstanceProfileArn;
}
/**
*
* A JSON formatted string containing the layer's custom stack configuration and deployment attributes.
*
*
* @return A JSON formatted string containing the layer's custom stack configuration and deployment attributes.
*/
public final String customJson() {
return customJson;
}
/**
* Returns true if the CustomSecurityGroupIds property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasCustomSecurityGroupIds() {
return customSecurityGroupIds != null && !(customSecurityGroupIds instanceof SdkAutoConstructList);
}
/**
*
* An array containing the layer's custom security group IDs.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasCustomSecurityGroupIds()} to see if a value was sent in this field.
*
*
* @return An array containing the layer's custom security group IDs.
*/
public final List customSecurityGroupIds() {
return customSecurityGroupIds;
}
/**
* Returns true if the DefaultSecurityGroupNames property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasDefaultSecurityGroupNames() {
return defaultSecurityGroupNames != null && !(defaultSecurityGroupNames instanceof SdkAutoConstructList);
}
/**
*
* An array containing the layer's security group names.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasDefaultSecurityGroupNames()} to see if a value was sent in this field.
*
*
* @return An array containing the layer's security group names.
*/
public final List defaultSecurityGroupNames() {
return defaultSecurityGroupNames;
}
/**
* Returns true if the Packages property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasPackages() {
return packages != null && !(packages instanceof SdkAutoConstructList);
}
/**
*
* An array of Package
objects that describe the layer's packages.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasPackages()} to see if a value was sent in this field.
*
*
* @return An array of Package
objects that describe the layer's packages.
*/
public final List packages() {
return packages;
}
/**
* Returns true if the VolumeConfigurations property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasVolumeConfigurations() {
return volumeConfigurations != null && !(volumeConfigurations instanceof SdkAutoConstructList);
}
/**
*
* A VolumeConfigurations
object that describes the layer's Amazon EBS volumes.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasVolumeConfigurations()} to see if a value was sent in this field.
*
*
* @return A VolumeConfigurations
object that describes the layer's Amazon EBS volumes.
*/
public final List volumeConfigurations() {
return volumeConfigurations;
}
/**
*
* Whether auto healing is disabled for the layer.
*
*
* @return Whether auto healing is disabled for the layer.
*/
public final Boolean enableAutoHealing() {
return enableAutoHealing;
}
/**
*
* Whether to automatically assign an Elastic IP address
* to the layer's instances. For more information, see How to Edit a
* Layer .
*
*
* @return Whether to automatically assign an Elastic IP
* address to the layer's instances. For more information, see How to Edit a
* Layer .
*/
public final Boolean autoAssignElasticIps() {
return autoAssignElasticIps;
}
/**
*
* For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's
* instances. For more information, see How to Edit a
* Layer .
*
*
* @return For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's
* instances. For more information, see How to Edit a
* Layer .
*/
public final Boolean autoAssignPublicIps() {
return autoAssignPublicIps;
}
/**
*
* AWS OpsWorks Stacks supports five lifecycle events: setup , configuration , deploy ,
* undeploy , and shutdown . For each layer, AWS OpsWorks Stacks runs a set of standard recipes for each
* event. You can also provide custom recipes for any or all layers and events. AWS OpsWorks Stacks runs custom
* event recipes after the standard recipes. LayerCustomRecipes
specifies the custom recipes for a
* particular layer to be run in response to each of the five events.
*
*
* To specify a recipe, use the cookbook's directory name in the repository followed by two colons and the recipe
* name, which is the recipe's file name without the .rb
extension. For example:
* phpapp2::dbsetup
specifies the dbsetup.rb
recipe in the repository's
* phpapp2
folder.
*
*
* @return AWS OpsWorks Stacks supports five lifecycle events: setup , configuration , deploy ,
* undeploy , and shutdown . For each layer, AWS OpsWorks Stacks runs a set of standard recipes
* for each event. You can also provide custom recipes for any or all layers and events. AWS OpsWorks Stacks
* runs custom event recipes after the standard recipes. LayerCustomRecipes
specifies the
* custom recipes for a particular layer to be run in response to each of the five events.
*
* To specify a recipe, use the cookbook's directory name in the repository followed by two colons and the
* recipe name, which is the recipe's file name without the .rb
extension. For example:
* phpapp2::dbsetup
specifies the dbsetup.rb
recipe in the repository's
* phpapp2
folder.
*/
public final Recipes defaultRecipes() {
return defaultRecipes;
}
/**
*
* A LayerCustomRecipes
object that specifies the layer's custom recipes.
*
*
* @return A LayerCustomRecipes
object that specifies the layer's custom recipes.
*/
public final Recipes customRecipes() {
return customRecipes;
}
/**
*
* Date when the layer was created.
*
*
* @return Date when the layer was created.
*/
public final String createdAt() {
return createdAt;
}
/**
*
* Whether to install operating system and package updates when the instance boots. The default value is
* true
. If this value is set to false
, you must then update your instances manually by
* using CreateDeployment to run the update_dependencies
stack command or manually running
* yum
(Amazon Linux) or apt-get
(Ubuntu) on the instances.
*
*
*
* We strongly recommend using the default value of true
, to ensure that your instances have the latest
* security updates.
*
*
*
* @return Whether to install operating system and package updates when the instance boots. The default value is
* true
. If this value is set to false
, you must then update your instances
* manually by using CreateDeployment to run the update_dependencies
stack command or
* manually running yum
(Amazon Linux) or apt-get
(Ubuntu) on the instances.
*
*
* We strongly recommend using the default value of true
, to ensure that your instances have
* the latest security updates.
*
*/
public final Boolean installUpdatesOnBoot() {
return installUpdatesOnBoot;
}
/**
*
* Whether the layer uses Amazon EBS-optimized instances.
*
*
* @return Whether the layer uses Amazon EBS-optimized instances.
*/
public final Boolean useEbsOptimizedInstances() {
return useEbsOptimizedInstances;
}
/**
*
* A LifeCycleEventConfiguration
object that specifies the Shutdown event configuration.
*
*
* @return A LifeCycleEventConfiguration
object that specifies the Shutdown event configuration.
*/
public final LifecycleEventConfiguration lifecycleEventConfiguration() {
return lifecycleEventConfiguration;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(stackId());
hashCode = 31 * hashCode + Objects.hashCode(layerId());
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(shortname());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributesAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLogsConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(customInstanceProfileArn());
hashCode = 31 * hashCode + Objects.hashCode(customJson());
hashCode = 31 * hashCode + Objects.hashCode(hasCustomSecurityGroupIds() ? customSecurityGroupIds() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasDefaultSecurityGroupNames() ? defaultSecurityGroupNames() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasPackages() ? packages() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasVolumeConfigurations() ? volumeConfigurations() : null);
hashCode = 31 * hashCode + Objects.hashCode(enableAutoHealing());
hashCode = 31 * hashCode + Objects.hashCode(autoAssignElasticIps());
hashCode = 31 * hashCode + Objects.hashCode(autoAssignPublicIps());
hashCode = 31 * hashCode + Objects.hashCode(defaultRecipes());
hashCode = 31 * hashCode + Objects.hashCode(customRecipes());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(installUpdatesOnBoot());
hashCode = 31 * hashCode + Objects.hashCode(useEbsOptimizedInstances());
hashCode = 31 * hashCode + Objects.hashCode(lifecycleEventConfiguration());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Layer)) {
return false;
}
Layer other = (Layer) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(stackId(), other.stackId())
&& Objects.equals(layerId(), other.layerId()) && Objects.equals(typeAsString(), other.typeAsString())
&& Objects.equals(name(), other.name()) && Objects.equals(shortname(), other.shortname())
&& hasAttributes() == other.hasAttributes() && Objects.equals(attributesAsStrings(), other.attributesAsStrings())
&& Objects.equals(cloudWatchLogsConfiguration(), other.cloudWatchLogsConfiguration())
&& Objects.equals(customInstanceProfileArn(), other.customInstanceProfileArn())
&& Objects.equals(customJson(), other.customJson())
&& hasCustomSecurityGroupIds() == other.hasCustomSecurityGroupIds()
&& Objects.equals(customSecurityGroupIds(), other.customSecurityGroupIds())
&& hasDefaultSecurityGroupNames() == other.hasDefaultSecurityGroupNames()
&& Objects.equals(defaultSecurityGroupNames(), other.defaultSecurityGroupNames())
&& hasPackages() == other.hasPackages() && Objects.equals(packages(), other.packages())
&& hasVolumeConfigurations() == other.hasVolumeConfigurations()
&& Objects.equals(volumeConfigurations(), other.volumeConfigurations())
&& Objects.equals(enableAutoHealing(), other.enableAutoHealing())
&& Objects.equals(autoAssignElasticIps(), other.autoAssignElasticIps())
&& Objects.equals(autoAssignPublicIps(), other.autoAssignPublicIps())
&& Objects.equals(defaultRecipes(), other.defaultRecipes())
&& Objects.equals(customRecipes(), other.customRecipes()) && Objects.equals(createdAt(), other.createdAt())
&& Objects.equals(installUpdatesOnBoot(), other.installUpdatesOnBoot())
&& Objects.equals(useEbsOptimizedInstances(), other.useEbsOptimizedInstances())
&& Objects.equals(lifecycleEventConfiguration(), other.lifecycleEventConfiguration());
}
/**
* 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("Layer").add("Arn", arn()).add("StackId", stackId()).add("LayerId", layerId())
.add("Type", typeAsString()).add("Name", name()).add("Shortname", shortname())
.add("Attributes", hasAttributes() ? attributesAsStrings() : null)
.add("CloudWatchLogsConfiguration", cloudWatchLogsConfiguration())
.add("CustomInstanceProfileArn", customInstanceProfileArn()).add("CustomJson", customJson())
.add("CustomSecurityGroupIds", hasCustomSecurityGroupIds() ? customSecurityGroupIds() : null)
.add("DefaultSecurityGroupNames", hasDefaultSecurityGroupNames() ? defaultSecurityGroupNames() : null)
.add("Packages", hasPackages() ? packages() : null)
.add("VolumeConfigurations", hasVolumeConfigurations() ? volumeConfigurations() : null)
.add("EnableAutoHealing", enableAutoHealing()).add("AutoAssignElasticIps", autoAssignElasticIps())
.add("AutoAssignPublicIps", autoAssignPublicIps()).add("DefaultRecipes", defaultRecipes())
.add("CustomRecipes", customRecipes()).add("CreatedAt", createdAt())
.add("InstallUpdatesOnBoot", installUpdatesOnBoot()).add("UseEbsOptimizedInstances", useEbsOptimizedInstances())
.add("LifecycleEventConfiguration", lifecycleEventConfiguration()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
case "StackId":
return Optional.ofNullable(clazz.cast(stackId()));
case "LayerId":
return Optional.ofNullable(clazz.cast(layerId()));
case "Type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Shortname":
return Optional.ofNullable(clazz.cast(shortname()));
case "Attributes":
return Optional.ofNullable(clazz.cast(attributesAsStrings()));
case "CloudWatchLogsConfiguration":
return Optional.ofNullable(clazz.cast(cloudWatchLogsConfiguration()));
case "CustomInstanceProfileArn":
return Optional.ofNullable(clazz.cast(customInstanceProfileArn()));
case "CustomJson":
return Optional.ofNullable(clazz.cast(customJson()));
case "CustomSecurityGroupIds":
return Optional.ofNullable(clazz.cast(customSecurityGroupIds()));
case "DefaultSecurityGroupNames":
return Optional.ofNullable(clazz.cast(defaultSecurityGroupNames()));
case "Packages":
return Optional.ofNullable(clazz.cast(packages()));
case "VolumeConfigurations":
return Optional.ofNullable(clazz.cast(volumeConfigurations()));
case "EnableAutoHealing":
return Optional.ofNullable(clazz.cast(enableAutoHealing()));
case "AutoAssignElasticIps":
return Optional.ofNullable(clazz.cast(autoAssignElasticIps()));
case "AutoAssignPublicIps":
return Optional.ofNullable(clazz.cast(autoAssignPublicIps()));
case "DefaultRecipes":
return Optional.ofNullable(clazz.cast(defaultRecipes()));
case "CustomRecipes":
return Optional.ofNullable(clazz.cast(customRecipes()));
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "InstallUpdatesOnBoot":
return Optional.ofNullable(clazz.cast(installUpdatesOnBoot()));
case "UseEbsOptimizedInstances":
return Optional.ofNullable(clazz.cast(useEbsOptimizedInstances()));
case "LifecycleEventConfiguration":
return Optional.ofNullable(clazz.cast(lifecycleEventConfiguration()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((Layer) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The Amazon Resource Number (ARN) of a layer.
*
*
* @param arn
* The Amazon Resource Number (ARN) of a layer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder arn(String arn);
/**
*
* The layer stack ID.
*
*
* @param stackId
* The layer stack ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stackId(String stackId);
/**
*
* The layer ID.
*
*
* @param layerId
* The layer ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder layerId(String layerId);
/**
*
* The layer type.
*
*
* @param type
* The layer type.
* @see LayerType
* @return Returns a reference to this object so that method calls can be chained together.
* @see LayerType
*/
Builder type(String type);
/**
*
* The layer type.
*
*
* @param type
* The layer type.
* @see LayerType
* @return Returns a reference to this object so that method calls can be chained together.
* @see LayerType
*/
Builder type(LayerType type);
/**
*
* The layer name.
*
*
* @param name
* The layer name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* The layer short name.
*
*
* @param shortname
* The layer short name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder shortname(String shortname);
/**
*
* The layer attributes.
*
*
* For the HaproxyStatsPassword
, MysqlRootPassword
, and GangliaPassword
* attributes, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value
*
*
* For an ECS Cluster layer, AWS OpsWorks Stacks the EcsClusterArn
attribute is set to the
* cluster's ARN.
*
*
* @param attributes
* The layer attributes.
*
* For the HaproxyStatsPassword
, MysqlRootPassword
, and
* GangliaPassword
attributes, AWS OpsWorks Stacks returns *****FILTERED*****
* instead of the actual value
*
*
* For an ECS Cluster layer, AWS OpsWorks Stacks the EcsClusterArn
attribute is set to the
* cluster's ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributesWithStrings(Map attributes);
/**
*
* The layer attributes.
*
*
* For the HaproxyStatsPassword
, MysqlRootPassword
, and GangliaPassword
* attributes, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value
*
*
* For an ECS Cluster layer, AWS OpsWorks Stacks the EcsClusterArn
attribute is set to the
* cluster's ARN.
*
*
* @param attributes
* The layer attributes.
*
* For the HaproxyStatsPassword
, MysqlRootPassword
, and
* GangliaPassword
attributes, AWS OpsWorks Stacks returns *****FILTERED*****
* instead of the actual value
*
*
* For an ECS Cluster layer, AWS OpsWorks Stacks the EcsClusterArn
attribute is set to the
* cluster's ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributes(Map attributes);
/**
*
* The Amazon CloudWatch Logs configuration settings for the layer.
*
*
* @param cloudWatchLogsConfiguration
* The Amazon CloudWatch Logs configuration settings for the layer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cloudWatchLogsConfiguration(CloudWatchLogsConfiguration cloudWatchLogsConfiguration);
/**
*
* The Amazon CloudWatch Logs configuration settings for the layer.
*
* This is a convenience that creates an instance of the {@link CloudWatchLogsConfiguration.Builder} avoiding
* the need to create one manually via {@link CloudWatchLogsConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link CloudWatchLogsConfiguration.Builder#build()} is called
* immediately and its result is passed to {@link #cloudWatchLogsConfiguration(CloudWatchLogsConfiguration)}.
*
* @param cloudWatchLogsConfiguration
* a consumer that will call methods on {@link CloudWatchLogsConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #cloudWatchLogsConfiguration(CloudWatchLogsConfiguration)
*/
default Builder cloudWatchLogsConfiguration(Consumer cloudWatchLogsConfiguration) {
return cloudWatchLogsConfiguration(CloudWatchLogsConfiguration.builder().applyMutation(cloudWatchLogsConfiguration)
.build());
}
/**
*
* The ARN of the default IAM profile to be used for the layer's EC2 instances. For more information about IAM
* ARNs, see Using
* Identifiers .
*
*
* @param customInstanceProfileArn
* The ARN of the default IAM profile to be used for the layer'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 customInstanceProfileArn(String customInstanceProfileArn);
/**
*
* A JSON formatted string containing the layer's custom stack configuration and deployment attributes.
*
*
* @param customJson
* A JSON formatted string containing the layer's custom stack configuration and deployment attributes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customJson(String customJson);
/**
*
* An array containing the layer's custom security group IDs.
*
*
* @param customSecurityGroupIds
* An array containing the layer's custom security group IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customSecurityGroupIds(Collection customSecurityGroupIds);
/**
*
* An array containing the layer's custom security group IDs.
*
*
* @param customSecurityGroupIds
* An array containing the layer's custom security group IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customSecurityGroupIds(String... customSecurityGroupIds);
/**
*
* An array containing the layer's security group names.
*
*
* @param defaultSecurityGroupNames
* An array containing the layer's security group names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultSecurityGroupNames(Collection defaultSecurityGroupNames);
/**
*
* An array containing the layer's security group names.
*
*
* @param defaultSecurityGroupNames
* An array containing the layer's security group names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultSecurityGroupNames(String... defaultSecurityGroupNames);
/**
*
* An array of Package
objects that describe the layer's packages.
*
*
* @param packages
* An array of Package
objects that describe the layer's packages.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder packages(Collection packages);
/**
*
* An array of Package
objects that describe the layer's packages.
*
*
* @param packages
* An array of Package
objects that describe the layer's packages.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder packages(String... packages);
/**
*
* A VolumeConfigurations
object that describes the layer's Amazon EBS volumes.
*
*
* @param volumeConfigurations
* A VolumeConfigurations
object that describes the layer's Amazon EBS volumes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder volumeConfigurations(Collection volumeConfigurations);
/**
*
* A VolumeConfigurations
object that describes the layer's Amazon EBS volumes.
*
*
* @param volumeConfigurations
* A VolumeConfigurations
object that describes the layer's Amazon EBS volumes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder volumeConfigurations(VolumeConfiguration... volumeConfigurations);
/**
*
* A VolumeConfigurations
object that describes the layer's Amazon EBS volumes.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the
* need to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately
* and its result is passed to {@link #volumeConfigurations(List)}.
*
* @param volumeConfigurations
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #volumeConfigurations(List)
*/
Builder volumeConfigurations(Consumer... volumeConfigurations);
/**
*
* Whether auto healing is disabled for the layer.
*
*
* @param enableAutoHealing
* Whether auto healing is disabled for the layer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder enableAutoHealing(Boolean enableAutoHealing);
/**
*
* Whether to automatically assign an Elastic IP
* address to the layer's instances. For more information, see How to Edit a
* Layer .
*
*
* @param autoAssignElasticIps
* Whether to automatically assign an Elastic IP
* address to the layer's instances. For more information, see How to
* Edit a Layer .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder autoAssignElasticIps(Boolean autoAssignElasticIps);
/**
*
* For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's
* instances. For more information, see How to Edit a
* Layer .
*
*
* @param autoAssignPublicIps
* For stacks that are running in a VPC, whether to automatically assign a public IP address to the
* layer's instances. For more information, see How to
* Edit a Layer .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder autoAssignPublicIps(Boolean autoAssignPublicIps);
/**
*
* AWS OpsWorks Stacks supports five lifecycle events: setup , configuration , deploy ,
* undeploy , and shutdown . For each layer, AWS OpsWorks Stacks runs a set of standard recipes for
* each event. You can also provide custom recipes for any or all layers and events. AWS OpsWorks Stacks runs
* custom event recipes after the standard recipes. LayerCustomRecipes
specifies the custom recipes
* for a particular layer to be run in response to each of the five events.
*
*
* To specify a recipe, use the cookbook's directory name in the repository followed by two colons and the
* recipe name, which is the recipe's file name without the .rb
extension. For example:
* phpapp2::dbsetup
specifies the dbsetup.rb
recipe in the repository's
* phpapp2
folder.
*
*
* @param defaultRecipes
* AWS OpsWorks Stacks supports five lifecycle events: setup , configuration , deploy ,
* undeploy , and shutdown . For each layer, AWS OpsWorks Stacks runs a set of standard
* recipes for each event. You can also provide custom recipes for any or all layers and events. AWS
* OpsWorks Stacks runs custom event recipes after the standard recipes. LayerCustomRecipes
* specifies the custom recipes for a particular layer to be run in response to each of the five
* events.
*
* To specify a recipe, use the cookbook's directory name in the repository followed by two colons and
* the recipe name, which is the recipe's file name without the .rb
extension. For example:
* phpapp2::dbsetup
specifies the dbsetup.rb
recipe in the repository's
* phpapp2
folder.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultRecipes(Recipes defaultRecipes);
/**
*
* AWS OpsWorks Stacks supports five lifecycle events: setup , configuration , deploy ,
* undeploy , and shutdown . For each layer, AWS OpsWorks Stacks runs a set of standard recipes for
* each event. You can also provide custom recipes for any or all layers and events. AWS OpsWorks Stacks runs
* custom event recipes after the standard recipes. LayerCustomRecipes
specifies the custom recipes
* for a particular layer to be run in response to each of the five events.
*
*
* To specify a recipe, use the cookbook's directory name in the repository followed by two colons and the
* recipe name, which is the recipe's file name without the .rb
extension. For example:
* phpapp2::dbsetup
specifies the dbsetup.rb
recipe in the repository's
* phpapp2
folder.
*
* This is a convenience that creates an instance of the {@link Recipes.Builder} avoiding the need to create one
* manually via {@link Recipes#builder()}.
*
* When the {@link Consumer} completes, {@link Recipes.Builder#build()} is called immediately and its result is
* passed to {@link #defaultRecipes(Recipes)}.
*
* @param defaultRecipes
* a consumer that will call methods on {@link Recipes.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #defaultRecipes(Recipes)
*/
default Builder defaultRecipes(Consumer defaultRecipes) {
return defaultRecipes(Recipes.builder().applyMutation(defaultRecipes).build());
}
/**
*
* A LayerCustomRecipes
object that specifies the layer's custom recipes.
*
*
* @param customRecipes
* A LayerCustomRecipes
object that specifies the layer's custom recipes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customRecipes(Recipes customRecipes);
/**
*
* A LayerCustomRecipes
object that specifies the layer's custom recipes.
*
* This is a convenience that creates an instance of the {@link Recipes.Builder} avoiding the need to create one
* manually via {@link Recipes#builder()}.
*
* When the {@link Consumer} completes, {@link Recipes.Builder#build()} is called immediately and its result is
* passed to {@link #customRecipes(Recipes)}.
*
* @param customRecipes
* a consumer that will call methods on {@link Recipes.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #customRecipes(Recipes)
*/
default Builder customRecipes(Consumer customRecipes) {
return customRecipes(Recipes.builder().applyMutation(customRecipes).build());
}
/**
*
* Date when the layer was created.
*
*
* @param createdAt
* Date when the layer was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createdAt(String createdAt);
/**
*
* Whether to install operating system and package updates when the instance boots. The default value is
* true
. If this value is set to false
, you must then update your instances manually
* by using CreateDeployment to run the update_dependencies
stack command or manually
* running yum
(Amazon Linux) or apt-get
(Ubuntu) on the instances.
*
*
*
* We strongly recommend using the default value of true
, to ensure that your instances have the
* latest security updates.
*
*
*
* @param installUpdatesOnBoot
* Whether to install operating system and package updates when the instance boots. The default value is
* true
. If this value is set to false
, you must then update your instances
* manually by using CreateDeployment to run the update_dependencies
stack command or
* manually running yum
(Amazon Linux) or apt-get
(Ubuntu) on the instances.
*
*
* We strongly recommend using the default value of true
, to ensure that your instances have
* the latest security updates.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder installUpdatesOnBoot(Boolean installUpdatesOnBoot);
/**
*
* Whether the layer uses Amazon EBS-optimized instances.
*
*
* @param useEbsOptimizedInstances
* Whether the layer uses Amazon EBS-optimized instances.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder useEbsOptimizedInstances(Boolean useEbsOptimizedInstances);
/**
*
* A LifeCycleEventConfiguration
object that specifies the Shutdown event configuration.
*
*
* @param lifecycleEventConfiguration
* A LifeCycleEventConfiguration
object that specifies the Shutdown event configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lifecycleEventConfiguration(LifecycleEventConfiguration lifecycleEventConfiguration);
/**
*
* A LifeCycleEventConfiguration
object that specifies the Shutdown event configuration.
*
* This is a convenience that creates an instance of the {@link LifecycleEventConfiguration.Builder} avoiding
* the need to create one manually via {@link LifecycleEventConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link LifecycleEventConfiguration.Builder#build()} is called
* immediately and its result is passed to {@link #lifecycleEventConfiguration(LifecycleEventConfiguration)}.
*
* @param lifecycleEventConfiguration
* a consumer that will call methods on {@link LifecycleEventConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #lifecycleEventConfiguration(LifecycleEventConfiguration)
*/
default Builder lifecycleEventConfiguration(Consumer lifecycleEventConfiguration) {
return lifecycleEventConfiguration(LifecycleEventConfiguration.builder().applyMutation(lifecycleEventConfiguration)
.build());
}
}
static final class BuilderImpl implements Builder {
private String arn;
private String stackId;
private String layerId;
private String type;
private String name;
private String shortname;
private Map attributes = DefaultSdkAutoConstructMap.getInstance();
private CloudWatchLogsConfiguration cloudWatchLogsConfiguration;
private String customInstanceProfileArn;
private String customJson;
private List customSecurityGroupIds = DefaultSdkAutoConstructList.getInstance();
private List defaultSecurityGroupNames = DefaultSdkAutoConstructList.getInstance();
private List packages = DefaultSdkAutoConstructList.getInstance();
private List volumeConfigurations = DefaultSdkAutoConstructList.getInstance();
private Boolean enableAutoHealing;
private Boolean autoAssignElasticIps;
private Boolean autoAssignPublicIps;
private Recipes defaultRecipes;
private Recipes customRecipes;
private String createdAt;
private Boolean installUpdatesOnBoot;
private Boolean useEbsOptimizedInstances;
private LifecycleEventConfiguration lifecycleEventConfiguration;
private BuilderImpl() {
}
private BuilderImpl(Layer model) {
arn(model.arn);
stackId(model.stackId);
layerId(model.layerId);
type(model.type);
name(model.name);
shortname(model.shortname);
attributesWithStrings(model.attributes);
cloudWatchLogsConfiguration(model.cloudWatchLogsConfiguration);
customInstanceProfileArn(model.customInstanceProfileArn);
customJson(model.customJson);
customSecurityGroupIds(model.customSecurityGroupIds);
defaultSecurityGroupNames(model.defaultSecurityGroupNames);
packages(model.packages);
volumeConfigurations(model.volumeConfigurations);
enableAutoHealing(model.enableAutoHealing);
autoAssignElasticIps(model.autoAssignElasticIps);
autoAssignPublicIps(model.autoAssignPublicIps);
defaultRecipes(model.defaultRecipes);
customRecipes(model.customRecipes);
createdAt(model.createdAt);
installUpdatesOnBoot(model.installUpdatesOnBoot);
useEbsOptimizedInstances(model.useEbsOptimizedInstances);
lifecycleEventConfiguration(model.lifecycleEventConfiguration);
}
public final String getArn() {
return arn;
}
@Override
public final Builder arn(String arn) {
this.arn = arn;
return this;
}
public final void setArn(String arn) {
this.arn = arn;
}
public final String getStackId() {
return stackId;
}
@Override
public final Builder stackId(String stackId) {
this.stackId = stackId;
return this;
}
public final void setStackId(String stackId) {
this.stackId = stackId;
}
public final String getLayerId() {
return layerId;
}
@Override
public final Builder layerId(String layerId) {
this.layerId = layerId;
return this;
}
public final void setLayerId(String layerId) {
this.layerId = layerId;
}
public final String getType() {
return type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(LayerType type) {
this.type(type == null ? null : type.toString());
return this;
}
public final void setType(String type) {
this.type = type;
}
public final String getName() {
return name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final void setName(String name) {
this.name = name;
}
public final String getShortname() {
return shortname;
}
@Override
public final Builder shortname(String shortname) {
this.shortname = shortname;
return this;
}
public final void setShortname(String shortname) {
this.shortname = shortname;
}
public final Map getAttributes() {
if (attributes instanceof SdkAutoConstructMap) {
return null;
}
return attributes;
}
@Override
public final Builder attributesWithStrings(Map attributes) {
this.attributes = LayerAttributesCopier.copy(attributes);
return this;
}
@Override
public final Builder attributes(Map attributes) {
this.attributes = LayerAttributesCopier.copyEnumToString(attributes);
return this;
}
public final void setAttributes(Map attributes) {
this.attributes = LayerAttributesCopier.copy(attributes);
}
public final CloudWatchLogsConfiguration.Builder getCloudWatchLogsConfiguration() {
return cloudWatchLogsConfiguration != null ? cloudWatchLogsConfiguration.toBuilder() : null;
}
@Override
public final Builder cloudWatchLogsConfiguration(CloudWatchLogsConfiguration cloudWatchLogsConfiguration) {
this.cloudWatchLogsConfiguration = cloudWatchLogsConfiguration;
return this;
}
public final void setCloudWatchLogsConfiguration(CloudWatchLogsConfiguration.BuilderImpl cloudWatchLogsConfiguration) {
this.cloudWatchLogsConfiguration = cloudWatchLogsConfiguration != null ? cloudWatchLogsConfiguration.build() : null;
}
public final String getCustomInstanceProfileArn() {
return customInstanceProfileArn;
}
@Override
public final Builder customInstanceProfileArn(String customInstanceProfileArn) {
this.customInstanceProfileArn = customInstanceProfileArn;
return this;
}
public final void setCustomInstanceProfileArn(String customInstanceProfileArn) {
this.customInstanceProfileArn = customInstanceProfileArn;
}
public final String getCustomJson() {
return customJson;
}
@Override
public final Builder customJson(String customJson) {
this.customJson = customJson;
return this;
}
public final void setCustomJson(String customJson) {
this.customJson = customJson;
}
public final Collection getCustomSecurityGroupIds() {
if (customSecurityGroupIds instanceof SdkAutoConstructList) {
return null;
}
return customSecurityGroupIds;
}
@Override
public final Builder customSecurityGroupIds(Collection customSecurityGroupIds) {
this.customSecurityGroupIds = StringsCopier.copy(customSecurityGroupIds);
return this;
}
@Override
@SafeVarargs
public final Builder customSecurityGroupIds(String... customSecurityGroupIds) {
customSecurityGroupIds(Arrays.asList(customSecurityGroupIds));
return this;
}
public final void setCustomSecurityGroupIds(Collection customSecurityGroupIds) {
this.customSecurityGroupIds = StringsCopier.copy(customSecurityGroupIds);
}
public final Collection getDefaultSecurityGroupNames() {
if (defaultSecurityGroupNames instanceof SdkAutoConstructList) {
return null;
}
return defaultSecurityGroupNames;
}
@Override
public final Builder defaultSecurityGroupNames(Collection defaultSecurityGroupNames) {
this.defaultSecurityGroupNames = StringsCopier.copy(defaultSecurityGroupNames);
return this;
}
@Override
@SafeVarargs
public final Builder defaultSecurityGroupNames(String... defaultSecurityGroupNames) {
defaultSecurityGroupNames(Arrays.asList(defaultSecurityGroupNames));
return this;
}
public final void setDefaultSecurityGroupNames(Collection defaultSecurityGroupNames) {
this.defaultSecurityGroupNames = StringsCopier.copy(defaultSecurityGroupNames);
}
public final Collection getPackages() {
if (packages instanceof SdkAutoConstructList) {
return null;
}
return packages;
}
@Override
public final Builder packages(Collection packages) {
this.packages = StringsCopier.copy(packages);
return this;
}
@Override
@SafeVarargs
public final Builder packages(String... packages) {
packages(Arrays.asList(packages));
return this;
}
public final void setPackages(Collection packages) {
this.packages = StringsCopier.copy(packages);
}
public final List getVolumeConfigurations() {
List result = VolumeConfigurationsCopier.copyToBuilder(this.volumeConfigurations);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
@Override
public final Builder volumeConfigurations(Collection volumeConfigurations) {
this.volumeConfigurations = VolumeConfigurationsCopier.copy(volumeConfigurations);
return this;
}
@Override
@SafeVarargs
public final Builder volumeConfigurations(VolumeConfiguration... volumeConfigurations) {
volumeConfigurations(Arrays.asList(volumeConfigurations));
return this;
}
@Override
@SafeVarargs
public final Builder volumeConfigurations(Consumer... volumeConfigurations) {
volumeConfigurations(Stream.of(volumeConfigurations).map(c -> VolumeConfiguration.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setVolumeConfigurations(Collection volumeConfigurations) {
this.volumeConfigurations = VolumeConfigurationsCopier.copyFromBuilder(volumeConfigurations);
}
public final Boolean getEnableAutoHealing() {
return enableAutoHealing;
}
@Override
public final Builder enableAutoHealing(Boolean enableAutoHealing) {
this.enableAutoHealing = enableAutoHealing;
return this;
}
public final void setEnableAutoHealing(Boolean enableAutoHealing) {
this.enableAutoHealing = enableAutoHealing;
}
public final Boolean getAutoAssignElasticIps() {
return autoAssignElasticIps;
}
@Override
public final Builder autoAssignElasticIps(Boolean autoAssignElasticIps) {
this.autoAssignElasticIps = autoAssignElasticIps;
return this;
}
public final void setAutoAssignElasticIps(Boolean autoAssignElasticIps) {
this.autoAssignElasticIps = autoAssignElasticIps;
}
public final Boolean getAutoAssignPublicIps() {
return autoAssignPublicIps;
}
@Override
public final Builder autoAssignPublicIps(Boolean autoAssignPublicIps) {
this.autoAssignPublicIps = autoAssignPublicIps;
return this;
}
public final void setAutoAssignPublicIps(Boolean autoAssignPublicIps) {
this.autoAssignPublicIps = autoAssignPublicIps;
}
public final Recipes.Builder getDefaultRecipes() {
return defaultRecipes != null ? defaultRecipes.toBuilder() : null;
}
@Override
public final Builder defaultRecipes(Recipes defaultRecipes) {
this.defaultRecipes = defaultRecipes;
return this;
}
public final void setDefaultRecipes(Recipes.BuilderImpl defaultRecipes) {
this.defaultRecipes = defaultRecipes != null ? defaultRecipes.build() : null;
}
public final Recipes.Builder getCustomRecipes() {
return customRecipes != null ? customRecipes.toBuilder() : null;
}
@Override
public final Builder customRecipes(Recipes customRecipes) {
this.customRecipes = customRecipes;
return this;
}
public final void setCustomRecipes(Recipes.BuilderImpl customRecipes) {
this.customRecipes = customRecipes != null ? customRecipes.build() : null;
}
public final String getCreatedAt() {
return createdAt;
}
@Override
public final Builder createdAt(String createdAt) {
this.createdAt = createdAt;
return this;
}
public final void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public final Boolean getInstallUpdatesOnBoot() {
return installUpdatesOnBoot;
}
@Override
public final Builder installUpdatesOnBoot(Boolean installUpdatesOnBoot) {
this.installUpdatesOnBoot = installUpdatesOnBoot;
return this;
}
public final void setInstallUpdatesOnBoot(Boolean installUpdatesOnBoot) {
this.installUpdatesOnBoot = installUpdatesOnBoot;
}
public final Boolean getUseEbsOptimizedInstances() {
return useEbsOptimizedInstances;
}
@Override
public final Builder useEbsOptimizedInstances(Boolean useEbsOptimizedInstances) {
this.useEbsOptimizedInstances = useEbsOptimizedInstances;
return this;
}
public final void setUseEbsOptimizedInstances(Boolean useEbsOptimizedInstances) {
this.useEbsOptimizedInstances = useEbsOptimizedInstances;
}
public final LifecycleEventConfiguration.Builder getLifecycleEventConfiguration() {
return lifecycleEventConfiguration != null ? lifecycleEventConfiguration.toBuilder() : null;
}
@Override
public final Builder lifecycleEventConfiguration(LifecycleEventConfiguration lifecycleEventConfiguration) {
this.lifecycleEventConfiguration = lifecycleEventConfiguration;
return this;
}
public final void setLifecycleEventConfiguration(LifecycleEventConfiguration.BuilderImpl lifecycleEventConfiguration) {
this.lifecycleEventConfiguration = lifecycleEventConfiguration != null ? lifecycleEventConfiguration.build() : null;
}
@Override
public Layer build() {
return new Layer(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}