All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.apigee.kotlin.EndpointAttachment.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.apigee.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [EndpointAttachment].
 */
@PulumiTagMarker
public class EndpointAttachmentResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: EndpointAttachmentArgs = EndpointAttachmentArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend EndpointAttachmentArgsBuilder.() -> Unit) {
        val builder = EndpointAttachmentArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): EndpointAttachment {
        val builtJavaResource = com.pulumi.gcp.apigee.EndpointAttachment(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return EndpointAttachment(builtJavaResource)
    }
}

/**
 * Apigee Endpoint Attachment.
 * To get more information about EndpointAttachment, see:
 * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.endpointAttachments/create)
 * * How-to Guides
 *     * [Creating an environment](https://cloud.google.com/apigee/docs/api-platform/get-started/create-environment)
 * ## Example Usage
 * ### Apigee Endpoint Attachment 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: 16,
 *     network: apigeeNetwork.id,
 * });
 * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", {
 *     network: apigeeNetwork.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [apigeeRange.name],
 * });
 * const apigeeOrg = new gcp.apigee.Organization("apigee_org", {
 *     analyticsRegion: "us-central1",
 *     projectId: current.then(current => current.project),
 *     authorizedNetwork: apigeeNetwork.id,
 * });
 * const apigeeEndpointAttachment = new gcp.apigee.EndpointAttachment("apigee_endpoint_attachment", {
 *     orgId: apigeeOrg.id,
 *     endpointAttachmentId: "test1",
 *     location: "{google_compute_service_attachment location}",
 *     serviceAttachment: "{google_compute_service_attachment id}",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * current = gcp.organizations.get_client_config()
 * apigee_network = gcp.compute.Network("apigee_network", name="apigee-network")
 * apigee_range = gcp.compute.GlobalAddress("apigee_range",
 *     name="apigee-range",
 *     purpose="VPC_PEERING",
 *     address_type="INTERNAL",
 *     prefix_length=16,
 *     network=apigee_network.id)
 * apigee_vpc_connection = gcp.servicenetworking.Connection("apigee_vpc_connection",
 *     network=apigee_network.id,
 *     service="servicenetworking.googleapis.com",
 *     reserved_peering_ranges=[apigee_range.name])
 * apigee_org = gcp.apigee.Organization("apigee_org",
 *     analytics_region="us-central1",
 *     project_id=current.project,
 *     authorized_network=apigee_network.id)
 * apigee_endpoint_attachment = gcp.apigee.EndpointAttachment("apigee_endpoint_attachment",
 *     org_id=apigee_org.id,
 *     endpoint_attachment_id="test1",
 *     location="{google_compute_service_attachment location}",
 *     service_attachment="{google_compute_service_attachment id}")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var current = Gcp.Organizations.GetClientConfig.Invoke();
 *     var apigeeNetwork = new Gcp.Compute.Network("apigee_network", new()
 *     {
 *         Name = "apigee-network",
 *     });
 *     var apigeeRange = new Gcp.Compute.GlobalAddress("apigee_range", new()
 *     {
 *         Name = "apigee-range",
 *         Purpose = "VPC_PEERING",
 *         AddressType = "INTERNAL",
 *         PrefixLength = 16,
 *         Network = apigeeNetwork.Id,
 *     });
 *     var apigeeVpcConnection = new Gcp.ServiceNetworking.Connection("apigee_vpc_connection", new()
 *     {
 *         Network = apigeeNetwork.Id,
 *         Service = "servicenetworking.googleapis.com",
 *         ReservedPeeringRanges = new[]
 *         {
 *             apigeeRange.Name,
 *         },
 *     });
 *     var apigeeOrg = new Gcp.Apigee.Organization("apigee_org", new()
 *     {
 *         AnalyticsRegion = "us-central1",
 *         ProjectId = current.Apply(getClientConfigResult => getClientConfigResult.Project),
 *         AuthorizedNetwork = apigeeNetwork.Id,
 *     });
 *     var apigeeEndpointAttachment = new Gcp.Apigee.EndpointAttachment("apigee_endpoint_attachment", new()
 *     {
 *         OrgId = apigeeOrg.Id,
 *         EndpointAttachmentId = "test1",
 *         Location = "{google_compute_service_attachment location}",
 *         ServiceAttachment = "{google_compute_service_attachment id}",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/apigee"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		current, err := organizations.GetClientConfig(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		apigeeNetwork, err := compute.NewNetwork(ctx, "apigee_network", &compute.NetworkArgs{
 * 			Name: pulumi.String("apigee-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		apigeeRange, err := compute.NewGlobalAddress(ctx, "apigee_range", &compute.GlobalAddressArgs{
 * 			Name:         pulumi.String("apigee-range"),
 * 			Purpose:      pulumi.String("VPC_PEERING"),
 * 			AddressType:  pulumi.String("INTERNAL"),
 * 			PrefixLength: pulumi.Int(16),
 * 			Network:      apigeeNetwork.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = servicenetworking.NewConnection(ctx, "apigee_vpc_connection", &servicenetworking.ConnectionArgs{
 * 			Network: apigeeNetwork.ID(),
 * 			Service: pulumi.String("servicenetworking.googleapis.com"),
 * 			ReservedPeeringRanges: pulumi.StringArray{
 * 				apigeeRange.Name,
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		apigeeOrg, err := apigee.NewOrganization(ctx, "apigee_org", &apigee.OrganizationArgs{
 * 			AnalyticsRegion:   pulumi.String("us-central1"),
 * 			ProjectId:         pulumi.String(current.Project),
 * 			AuthorizedNetwork: apigeeNetwork.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = apigee.NewEndpointAttachment(ctx, "apigee_endpoint_attachment", &apigee.EndpointAttachmentArgs{
 * 			OrgId:                apigeeOrg.ID(),
 * 			EndpointAttachmentId: pulumi.String("test1"),
 * 			Location:             pulumi.String("{google_compute_service_attachment location}"),
 * 			ServiceAttachment:    pulumi.String("{google_compute_service_attachment id}"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.GlobalAddress;
 * import com.pulumi.gcp.compute.GlobalAddressArgs;
 * import com.pulumi.gcp.servicenetworking.Connection;
 * import com.pulumi.gcp.servicenetworking.ConnectionArgs;
 * import com.pulumi.gcp.apigee.Organization;
 * import com.pulumi.gcp.apigee.OrganizationArgs;
 * import com.pulumi.gcp.apigee.EndpointAttachment;
 * import com.pulumi.gcp.apigee.EndpointAttachmentArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         final var current = OrganizationsFunctions.getClientConfig();
 *         var apigeeNetwork = new Network("apigeeNetwork", NetworkArgs.builder()
 *             .name("apigee-network")
 *             .build());
 *         var apigeeRange = new GlobalAddress("apigeeRange", GlobalAddressArgs.builder()
 *             .name("apigee-range")
 *             .purpose("VPC_PEERING")
 *             .addressType("INTERNAL")
 *             .prefixLength(16)
 *             .network(apigeeNetwork.id())
 *             .build());
 *         var apigeeVpcConnection = new Connection("apigeeVpcConnection", ConnectionArgs.builder()
 *             .network(apigeeNetwork.id())
 *             .service("servicenetworking.googleapis.com")
 *             .reservedPeeringRanges(apigeeRange.name())
 *             .build());
 *         var apigeeOrg = new Organization("apigeeOrg", OrganizationArgs.builder()
 *             .analyticsRegion("us-central1")
 *             .projectId(current.applyValue(getClientConfigResult -> getClientConfigResult.project()))
 *             .authorizedNetwork(apigeeNetwork.id())
 *             .build());
 *         var apigeeEndpointAttachment = new EndpointAttachment("apigeeEndpointAttachment", EndpointAttachmentArgs.builder()
 *             .orgId(apigeeOrg.id())
 *             .endpointAttachmentId("test1")
 *             .location("{google_compute_service_attachment location}")
 *             .serviceAttachment("{google_compute_service_attachment id}")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   apigeeNetwork:
 *     type: gcp:compute:Network
 *     name: apigee_network
 *     properties:
 *       name: apigee-network
 *   apigeeRange:
 *     type: gcp:compute:GlobalAddress
 *     name: apigee_range
 *     properties:
 *       name: apigee-range
 *       purpose: VPC_PEERING
 *       addressType: INTERNAL
 *       prefixLength: 16
 *       network: ${apigeeNetwork.id}
 *   apigeeVpcConnection:
 *     type: gcp:servicenetworking:Connection
 *     name: apigee_vpc_connection
 *     properties:
 *       network: ${apigeeNetwork.id}
 *       service: servicenetworking.googleapis.com
 *       reservedPeeringRanges:
 *         - ${apigeeRange.name}
 *   apigeeOrg:
 *     type: gcp:apigee:Organization
 *     name: apigee_org
 *     properties:
 *       analyticsRegion: us-central1
 *       projectId: ${current.project}
 *       authorizedNetwork: ${apigeeNetwork.id}
 *   apigeeEndpointAttachment:
 *     type: gcp:apigee:EndpointAttachment
 *     name: apigee_endpoint_attachment
 *     properties:
 *       orgId: ${apigeeOrg.id}
 *       endpointAttachmentId: test1
 *       location: '{google_compute_service_attachment location}'
 *       serviceAttachment: '{google_compute_service_attachment id}'
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: gcp:organizations:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * EndpointAttachment can be imported using any of these accepted formats:
 * * `{{org_id}}/endpointAttachments/{{endpoint_attachment_id}}`
 * * `{{org_id}}/{{endpoint_attachment_id}}`
 * When using the `pulumi import` command, EndpointAttachment can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:apigee/endpointAttachment:EndpointAttachment default {{org_id}}/endpointAttachments/{{endpoint_attachment_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:apigee/endpointAttachment:EndpointAttachment default {{org_id}}/{{endpoint_attachment_id}}
 * ```
 */
public class EndpointAttachment internal constructor(
    override val javaResource: com.pulumi.gcp.apigee.EndpointAttachment,
) : KotlinCustomResource(javaResource, EndpointAttachmentMapper) {
    /**
     * State of the endpoint attachment connection to the service attachment.
     */
    public val connectionState: Output
        get() = javaResource.connectionState().applyValue({ args0 -> args0 })

    /**
     * ID of the endpoint attachment.
     * - - -
     */
    public val endpointAttachmentId: Output
        get() = javaResource.endpointAttachmentId().applyValue({ args0 -> args0 })

    /**
     * Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
     */
    public val host: Output
        get() = javaResource.host().applyValue({ args0 -> args0 })

    /**
     * Location of the endpoint attachment.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Name of the Endpoint Attachment in the following format:
     * organizations/{organization}/endpointAttachments/{endpointAttachment}.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The Apigee Organization associated with the Apigee instance,
     * in the format `organizations/{{org_name}}`.
     */
    public val orgId: Output
        get() = javaResource.orgId().applyValue({ args0 -> args0 })

    /**
     * Format: projects/*/regions/*/serviceAttachments/*
     * */*/*/
     */
    public val serviceAttachment: Output
        get() = javaResource.serviceAttachment().applyValue({ args0 -> args0 })
}

public object EndpointAttachmentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.apigee.EndpointAttachment::class == javaResource::class

    override fun map(javaResource: Resource): EndpointAttachment = EndpointAttachment(
        javaResource as
            com.pulumi.gcp.apigee.EndpointAttachment,
    )
}

/**
 * @see [EndpointAttachment].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [EndpointAttachment].
 */
public suspend fun endpointAttachment(
    name: String,
    block: suspend EndpointAttachmentResourceBuilder.() -> Unit,
): EndpointAttachment {
    val builder = EndpointAttachmentResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [EndpointAttachment].
 * @param name The _unique_ name of the resulting resource.
 */
public fun endpointAttachment(name: String): EndpointAttachment {
    val builder = EndpointAttachmentResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy