UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

272 lines • 10.6 kB
import * as pulumi from "@pulumi/pulumi"; /** * Apigee NAT (network address translation) address. A NAT address is a static external IP address used for Internet egress traffic. This is not avaible for Apigee hybrid. * * To get more information about NatAddress, see: * * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.instances.natAddresses) * * How-to Guides * * [Provisioning NAT IPs](https://cloud.google.com/apigee/docs/api-platform/security/nat-provisioning) * * ## Example Usage * * ### Apigee Nat Address Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"}); * const apigeeRange = new gcp.compute.GlobalAddress("apigee_range", { * name: "apigee-range", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 21, * network: apigeeNetwork.id, * }); * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", { * network: apigeeNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [apigeeRange.name], * }); * const apigeeKeyring = new gcp.kms.KeyRing("apigee_keyring", { * name: "apigee-keyring", * location: "us-central1", * }); * const apigeeKey = new gcp.kms.CryptoKey("apigee_key", { * name: "apigee-key", * keyRing: apigeeKeyring.id, * }); * const apigeeSa = new gcp.projects.ServiceIdentity("apigee_sa", { * project: project.projectId, * service: apigee.service, * }); * const apigeeSaKeyuser = new gcp.kms.CryptoKeyIAMMember("apigee_sa_keyuser", { * cryptoKeyId: apigeeKey.id, * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: apigeeSa.member, * }); * const apigeeOrg = new gcp.apigee.Organization("apigee_org", { * analyticsRegion: "us-central1", * displayName: "apigee-org", * description: "Terraform-provisioned Apigee Org.", * projectId: current.then(current => current.project), * authorizedNetwork: apigeeNetwork.id, * runtimeDatabaseEncryptionKeyName: apigeeKey.id, * }, { * dependsOn: [ * apigeeVpcConnection, * apigeeSaKeyuser, * ], * }); * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", { * name: "apigee-instance", * location: "us-central1", * description: "Terraform-managed Apigee Runtime Instance", * displayName: "apigee-instance", * orgId: apigeeOrg.id, * diskEncryptionKeyName: apigeeKey.id, * }); * const apigee_nat = new gcp.apigee.NatAddress("apigee-nat", { * name: "my-nat-address", * instanceId: apigeeInstance.id, * }); * ``` * ### Apigee Nat Address With Activate * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"}); * const apigeeRange = new gcp.compute.GlobalAddress("apigee_range", { * name: "apigee-range", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 21, * network: apigeeNetwork.id, * }); * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", { * network: apigeeNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [apigeeRange.name], * }); * const apigeeKeyring = new gcp.kms.KeyRing("apigee_keyring", { * name: "apigee-keyring", * location: "us-central1", * }); * const apigeeKey = new gcp.kms.CryptoKey("apigee_key", { * name: "apigee-key", * keyRing: apigeeKeyring.id, * }); * const apigeeSa = new gcp.projects.ServiceIdentity("apigee_sa", { * project: project.projectId, * service: apigee.service, * }); * const apigeeSaKeyuser = new gcp.kms.CryptoKeyIAMMember("apigee_sa_keyuser", { * cryptoKeyId: apigeeKey.id, * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: apigeeSa.member, * }); * const apigeeOrg = new gcp.apigee.Organization("apigee_org", { * analyticsRegion: "us-central1", * displayName: "apigee-org", * description: "Terraform-provisioned Apigee Org.", * projectId: current.then(current => current.project), * authorizedNetwork: apigeeNetwork.id, * runtimeDatabaseEncryptionKeyName: apigeeKey.id, * }, { * dependsOn: [ * apigeeVpcConnection, * apigeeSaKeyuser, * ], * }); * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", { * name: "apigee-instance", * location: "us-central1", * description: "Terraform-managed Apigee Runtime Instance", * displayName: "apigee-instance", * orgId: apigeeOrg.id, * diskEncryptionKeyName: apigeeKey.id, * }); * const apigee_nat = new gcp.apigee.NatAddress("apigee-nat", { * name: "my-nat-address", * activate: true, * instanceId: apigeeInstance.id, * }); * ``` * * ## Import * * NatAddress can be imported using any of these accepted formats: * * * `{{instance_id}}/natAddresses/{{name}}` * * `{{instance_id}}/{{name}}` * * When using the `pulumi import` command, NatAddress can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apigee/natAddress:NatAddress default {{instance_id}}/natAddresses/{{name}} * $ pulumi import gcp:apigee/natAddress:NatAddress default {{instance_id}}/{{name}} * ``` */ export declare class NatAddress extends pulumi.CustomResource { /** * Get an existing NatAddress 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?: NatAddressState, opts?: pulumi.CustomResourceOptions): NatAddress; /** * Returns true if the given object is an instance of NatAddress. 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 NatAddress; /** * Flag that specifies whether the reserved NAT address should be activate. */ readonly activate: pulumi.Output<boolean | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ readonly deletionPolicy: pulumi.Output<string>; /** * The Apigee instance associated with the Apigee environment, * in the format `organizations/{{org_name}}/instances/{{instance_name}}`. */ readonly instanceId: pulumi.Output<string>; /** * The allocated NAT IP address. */ readonly ipAddress: pulumi.Output<string>; /** * Resource ID of the NAT address. */ readonly name: pulumi.Output<string>; /** * State of the NAT IP address. */ readonly state: pulumi.Output<string>; /** * Create a NatAddress 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: NatAddressArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering NatAddress resources. */ export interface NatAddressState { /** * Flag that specifies whether the reserved NAT address should be activate. */ activate?: pulumi.Input<boolean | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * The Apigee instance associated with the Apigee environment, * in the format `organizations/{{org_name}}/instances/{{instance_name}}`. */ instanceId?: pulumi.Input<string | undefined>; /** * The allocated NAT IP address. */ ipAddress?: pulumi.Input<string | undefined>; /** * Resource ID of the NAT address. */ name?: pulumi.Input<string | undefined>; /** * State of the NAT IP address. */ state?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a NatAddress resource. */ export interface NatAddressArgs { /** * Flag that specifies whether the reserved NAT address should be activate. */ activate?: pulumi.Input<boolean | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * The Apigee instance associated with the Apigee environment, * in the format `organizations/{{org_name}}/instances/{{instance_name}}`. */ instanceId: pulumi.Input<string>; /** * Resource ID of the NAT address. */ name?: pulumi.Input<string | undefined>; } //# sourceMappingURL=natAddress.d.ts.map