Class KeyPairProps.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.KeyPairProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<KeyPairProps>
Enclosing interface:
KeyPairProps

@Stability(Stable) public static final class KeyPairProps.Builder extends Object implements software.amazon.jsii.Builder<KeyPairProps>
A builder for KeyPairProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • format

      @Stability(Stable) public KeyPairProps.Builder format(KeyPairFormat format)
      Sets the value of KeyPairProps.getFormat()
      Parameters:
      format - The format of the key pair.
      Returns:
      this
    • keyPairName

      @Stability(Stable) public KeyPairProps.Builder keyPairName(String keyPairName)
      Parameters:
      keyPairName - A unique name for the key pair.
      Returns:
      this
    • publicKeyMaterial

      @Stability(Stable) public KeyPairProps.Builder publicKeyMaterial(String publicKeyMaterial)
      Parameters:
      publicKeyMaterial - The public key material. If this is provided the key is considered "imported". For imported keys, it is assumed that you already have the private key material so the private key material will not be returned or stored in AWS Systems Manager Parameter Store.
      Returns:
      this
    • type

      @Stability(Stable) public KeyPairProps.Builder type(KeyPairType type)
      Sets the value of KeyPairProps.getType()
      Parameters:
      type - The type of key pair.
      Returns:
      this
    • account

      @Stability(Stable) public KeyPairProps.Builder account(String account)
      Sets the value of ResourceProps.getAccount()
      Parameters:
      account - The AWS account ID this resource belongs to.
      Returns:
      this
    • environmentFromArn

      @Stability(Stable) public KeyPairProps.Builder environmentFromArn(String environmentFromArn)
      Parameters:
      environmentFromArn - ARN to deduce region and account from. The ARN is parsed and the account and region are taken from the ARN. This should be used for imported resources.

      Cannot be supplied together with either account or region.

      Returns:
      this
    • physicalName

      @Stability(Stable) public KeyPairProps.Builder physicalName(String physicalName)
      Parameters:
      physicalName - The value passed in by users to the physical name prop of the resource.
      • undefined implies that a physical name will be allocated by CloudFormation during deployment.
      • a concrete value implies a specific physical name
      • PhysicalName.GENERATE_IF_NEEDED is a marker that indicates that a physical will only be generated by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
      Returns:
      this
    • region

      @Stability(Stable) public KeyPairProps.Builder region(String region)
      Sets the value of ResourceProps.getRegion()
      Parameters:
      region - The AWS region this resource belongs to.
      Returns:
      this
    • build

      @Stability(Stable) public KeyPairProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<KeyPairProps>
      Returns:
      a new instance of KeyPairProps
      Throws:
      NullPointerException - if any required attribute was not provided