Class BastionHostLinuxProps.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.BastionHostLinuxProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<BastionHostLinuxProps>
- Enclosing interface:
BastionHostLinuxProps
@Stability(Stable)
public static final class BastionHostLinuxProps.Builder
extends Object
implements software.amazon.jsii.Builder<BastionHostLinuxProps>
A builder for
BastionHostLinuxProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionavailabilityZone
(String availabilityZone) Sets the value ofBastionHostLinuxProps.getAvailabilityZone()
blockDevices
(List<? extends BlockDevice> blockDevices) Sets the value ofBastionHostLinuxProps.getBlockDevices()
build()
Builds the configured instance.init
(CloudFormationInit init) Sets the value ofBastionHostLinuxProps.getInit()
initOptions
(ApplyCloudFormationInitOptions initOptions) Sets the value ofBastionHostLinuxProps.getInitOptions()
instanceName
(String instanceName) Sets the value ofBastionHostLinuxProps.getInstanceName()
instanceType
(InstanceType instanceType) Sets the value ofBastionHostLinuxProps.getInstanceType()
machineImage
(IMachineImage machineImage) Sets the value ofBastionHostLinuxProps.getMachineImage()
requireImdsv2
(Boolean requireImdsv2) Sets the value ofBastionHostLinuxProps.getRequireImdsv2()
securityGroup
(ISecurityGroup securityGroup) Sets the value ofBastionHostLinuxProps.getSecurityGroup()
subnetSelection
(SubnetSelection subnetSelection) Sets the value ofBastionHostLinuxProps.getSubnetSelection()
Sets the value ofBastionHostLinuxProps.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
vpc
Sets the value ofBastionHostLinuxProps.getVpc()
- Parameters:
vpc
- VPC to launch the instance in. This parameter is required.- Returns:
this
-
availabilityZone
Sets the value ofBastionHostLinuxProps.getAvailabilityZone()
- Parameters:
availabilityZone
- In which AZ to place the instance within the VPC.- Returns:
this
-
blockDevices
@Stability(Stable) public BastionHostLinuxProps.Builder blockDevices(List<? extends BlockDevice> blockDevices) Sets the value ofBastionHostLinuxProps.getBlockDevices()
- Parameters:
blockDevices
- Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes. Each instance that is launched has an associated root device volume, either an Amazon EBS volume or an instance store volume. You can use block device mappings to specify additional EBS volumes or instance store volumes to attach to an instance when it is launched.- Returns:
this
-
init
Sets the value ofBastionHostLinuxProps.getInit()
- Parameters:
init
- Apply the given CloudFormation Init configuration to the instance at startup.- Returns:
this
-
initOptions
@Stability(Stable) public BastionHostLinuxProps.Builder initOptions(ApplyCloudFormationInitOptions initOptions) Sets the value ofBastionHostLinuxProps.getInitOptions()
- Parameters:
initOptions
- Use the given options for applying CloudFormation Init. Describes the configsets to use and the timeout to wait- Returns:
this
-
instanceName
Sets the value ofBastionHostLinuxProps.getInstanceName()
- Parameters:
instanceName
- The name of the instance.- Returns:
this
-
instanceType
Sets the value ofBastionHostLinuxProps.getInstanceType()
- Parameters:
instanceType
- Type of instance to launch.- Returns:
this
-
machineImage
Sets the value ofBastionHostLinuxProps.getMachineImage()
- Parameters:
machineImage
- The machine image to use, assumed to have SSM Agent preinstalled.- Returns:
this
-
requireImdsv2
Sets the value ofBastionHostLinuxProps.getRequireImdsv2()
- Parameters:
requireImdsv2
- Whether IMDSv2 should be required on this instance.- Returns:
this
-
securityGroup
Sets the value ofBastionHostLinuxProps.getSecurityGroup()
- Parameters:
securityGroup
- Security Group to assign to this instance.- Returns:
this
-
subnetSelection
@Stability(Stable) public BastionHostLinuxProps.Builder subnetSelection(SubnetSelection subnetSelection) Sets the value ofBastionHostLinuxProps.getSubnetSelection()
- Parameters:
subnetSelection
- Select the subnets to run the bastion host in. Set this to PUBLIC if you need to connect to this instance via the internet and cannot use SSM. You have to allow port 22 manually by using the connections field- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<BastionHostLinuxProps>
- Returns:
- a new instance of
BastionHostLinuxProps
- Throws:
NullPointerException
- if any required attribute was not provided
-