UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

178 lines (177 loc) 7.63 kB
import * as pulumi from "@pulumi/pulumi"; /** * Provides an AWS EIP Association as a top level resource, to associate and disassociate Elastic IPs from AWS Instances and Network Interfaces. * * > **NOTE:** Do not use this resource to associate an EIP to `aws.lb.LoadBalancer` or `aws.ec2.NatGateway` resources. Instead use the `allocationId` available in those resources to allow AWS to manage the association, otherwise you will see `AuthFailure` errors. * * > **NOTE:** `aws.ec2.EipAssociation` is useful in scenarios where EIPs are either pre-existing or distributed to customers or users and therefore cannot be changed. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const web = new aws.ec2.Instance("web", { * ami: "ami-21f78e11", * availabilityZone: "us-west-2a", * instanceType: aws.ec2.InstanceType.T2_Micro, * tags: { * Name: "HelloWorld", * }, * }); * const example = new aws.ec2.Eip("example", {domain: "vpc"}); * const eipAssoc = new aws.ec2.EipAssociation("eip_assoc", { * instanceId: web.id, * allocationId: example.id, * }); * ``` * * ## Import * * Using `pulumi import`, import EIP Assocations using their association IDs. For example: * * ```sh * $ pulumi import aws:ec2/eipAssociation:EipAssociation test eipassoc-ab12c345 * ``` */ export declare class EipAssociation extends pulumi.CustomResource { /** * Get an existing EipAssociation resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EipAssociationState, opts?: pulumi.CustomResourceOptions): EipAssociation; /** * Returns true if the given object is an instance of EipAssociation. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is EipAssociation; /** * ID of the associated Elastic IP. * This argument is required despite being optional at the resource level due to legacy support for EC2-Classic networking. */ readonly allocationId: pulumi.Output<string>; /** * Whether to allow an Elastic IP address to be re-associated. * Defaults to `true`. */ readonly allowReassociation: pulumi.Output<boolean | undefined>; /** * ID of the instance. * The instance must have exactly one attached network interface. * You can specify either the instance ID or the network interface ID, but not both. */ readonly instanceId: pulumi.Output<string>; /** * ID of the network interface. * If the instance has more than one network interface, you must specify a network interface ID. * You can specify either the instance ID or the network interface ID, but not both. */ readonly networkInterfaceId: pulumi.Output<string>; /** * Primary or secondary private IP address to associate with the Elastic IP address. * If no private IP address is specified, the Elastic IP address is associated with the primary private IP address. */ readonly privateIpAddress: pulumi.Output<string>; /** * ) Address of the associated Elastic IP. */ readonly publicIp: pulumi.Output<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * Create a EipAssociation resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: EipAssociationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering EipAssociation resources. */ export interface EipAssociationState { /** * ID of the associated Elastic IP. * This argument is required despite being optional at the resource level due to legacy support for EC2-Classic networking. */ allocationId?: pulumi.Input<string>; /** * Whether to allow an Elastic IP address to be re-associated. * Defaults to `true`. */ allowReassociation?: pulumi.Input<boolean>; /** * ID of the instance. * The instance must have exactly one attached network interface. * You can specify either the instance ID or the network interface ID, but not both. */ instanceId?: pulumi.Input<string>; /** * ID of the network interface. * If the instance has more than one network interface, you must specify a network interface ID. * You can specify either the instance ID or the network interface ID, but not both. */ networkInterfaceId?: pulumi.Input<string>; /** * Primary or secondary private IP address to associate with the Elastic IP address. * If no private IP address is specified, the Elastic IP address is associated with the primary private IP address. */ privateIpAddress?: pulumi.Input<string>; /** * ) Address of the associated Elastic IP. */ publicIp?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a EipAssociation resource. */ export interface EipAssociationArgs { /** * ID of the associated Elastic IP. * This argument is required despite being optional at the resource level due to legacy support for EC2-Classic networking. */ allocationId?: pulumi.Input<string>; /** * Whether to allow an Elastic IP address to be re-associated. * Defaults to `true`. */ allowReassociation?: pulumi.Input<boolean>; /** * ID of the instance. * The instance must have exactly one attached network interface. * You can specify either the instance ID or the network interface ID, but not both. */ instanceId?: pulumi.Input<string>; /** * ID of the network interface. * If the instance has more than one network interface, you must specify a network interface ID. * You can specify either the instance ID or the network interface ID, but not both. */ networkInterfaceId?: pulumi.Input<string>; /** * Primary or secondary private IP address to associate with the Elastic IP address. * If no private IP address is specified, the Elastic IP address is associated with the primary private IP address. */ privateIpAddress?: pulumi.Input<string>; /** * ) Address of the associated Elastic IP. */ publicIp?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; }