com.pulumi.gcp.apigateway.kotlin.ApiConfig.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.apigateway.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.apigateway.kotlin.outputs.ApiConfigGatewayConfig
import com.pulumi.gcp.apigateway.kotlin.outputs.ApiConfigGrpcService
import com.pulumi.gcp.apigateway.kotlin.outputs.ApiConfigManagedServiceConfig
import com.pulumi.gcp.apigateway.kotlin.outputs.ApiConfigOpenapiDocument
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
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.apigateway.kotlin.outputs.ApiConfigGatewayConfig.Companion.toKotlin as apiConfigGatewayConfigToKotlin
import com.pulumi.gcp.apigateway.kotlin.outputs.ApiConfigGrpcService.Companion.toKotlin as apiConfigGrpcServiceToKotlin
import com.pulumi.gcp.apigateway.kotlin.outputs.ApiConfigManagedServiceConfig.Companion.toKotlin as apiConfigManagedServiceConfigToKotlin
import com.pulumi.gcp.apigateway.kotlin.outputs.ApiConfigOpenapiDocument.Companion.toKotlin as apiConfigOpenapiDocumentToKotlin
/**
* Builder for [ApiConfig].
*/
@PulumiTagMarker
public class ApiConfigResourceBuilder internal constructor() {
public var name: String? = null
public var args: ApiConfigArgs = ApiConfigArgs()
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 ApiConfigArgsBuilder.() -> Unit) {
val builder = ApiConfigArgsBuilder()
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(): ApiConfig {
val builtJavaResource = com.pulumi.gcp.apigateway.ApiConfig(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ApiConfig(builtJavaResource)
}
}
/**
* An API Configuration is an association of an API Controller Config and a Gateway Config
* To get more information about ApiConfig, see:
* * [API documentation](https://cloud.google.com/api-gateway/docs/reference/rest/v1beta/projects.locations.apis.configs)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/api-gateway/docs/creating-api-config)
* ## Example Usage
* ## Import
* ApiConfig can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/global/apis/{{api}}/configs/{{api_config_id}}`
* * `{{project}}/{{api}}/{{api_config_id}}`
* * `{{api}}/{{api_config_id}}`
* When using the `pulumi import` command, ApiConfig can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:apigateway/apiConfig:ApiConfig default projects/{{project}}/locations/global/apis/{{api}}/configs/{{api_config_id}}
* ```
* ```sh
* $ pulumi import gcp:apigateway/apiConfig:ApiConfig default {{project}}/{{api}}/{{api_config_id}}
* ```
* ```sh
* $ pulumi import gcp:apigateway/apiConfig:ApiConfig default {{api}}/{{api_config_id}}
* ```
*/
public class ApiConfig internal constructor(
override val javaResource: com.pulumi.gcp.apigateway.ApiConfig,
) : KotlinCustomResource(javaResource, ApiConfigMapper) {
/**
* The API to attach the config to.
* - - -
*/
public val api: Output
get() = javaResource.api().applyValue({ args0 -> args0 })
/**
* Identifier to assign to the API Config. Must be unique within scope of the parent resource(api).
*/
public val apiConfigId: Output
get() = javaResource.apiConfigId().applyValue({ args0 -> args0 })
/**
* Creates a unique name beginning with the
* specified prefix. If this and api_config_id are unspecified, a random value is chosen for the name.
*/
public val apiConfigIdPrefix: Output
get() = javaResource.apiConfigIdPrefix().applyValue({ args0 -> args0 })
/**
* A user-visible name for the API.
*/
public val displayName: Output
get() = javaResource.displayName().applyValue({ args0 -> args0 })
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
public val effectiveLabels: Output