com.pulumi.gcp.apigee.kotlin.EnvReferences.kt Maven / Gradle / Ivy
@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 [EnvReferences].
*/
@PulumiTagMarker
public class EnvReferencesResourceBuilder internal constructor() {
public var name: String? = null
public var args: EnvReferencesArgs = EnvReferencesArgs()
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 EnvReferencesArgsBuilder.() -> Unit) {
val builder = EnvReferencesArgsBuilder()
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(): EnvReferences {
val builtJavaResource = com.pulumi.gcp.apigee.EnvReferences(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return EnvReferences(builtJavaResource)
}
}
/**
* An `Environment Reference` in Apigee.
* To get more information about EnvReferences, see:
* * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.references/create)
* * How-to Guides
* * [Creating an environment](https://cloud.google.com/apigee/docs/api-platform/get-started/create-environment)
* ## Import
* EnvReferences can be imported using any of these accepted formats:
* * `{{env_id}}/references/{{name}}`
* * `{{env_id}}/{{name}}`
* When using the `pulumi import` command, EnvReferences can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:apigee/envReferences:EnvReferences default {{env_id}}/references/{{name}}
* ```
* ```sh
* $ pulumi import gcp:apigee/envReferences:EnvReferences default {{env_id}}/{{name}}
* ```
*/
public class EnvReferences internal constructor(
override val javaResource: com.pulumi.gcp.apigee.EnvReferences,
) : KotlinCustomResource(javaResource, EnvReferencesMapper) {
/**
* Optional. A human-readable description of this reference.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Apigee environment group associated with the Apigee environment,
* in the format `organizations/{{org_name}}/environments/{{env_name}}`.
* - - -
*/
public val envId: Output
get() = javaResource.envId().applyValue({ args0 -> args0 })
/**
* Required. The resource id of this reference. Values must match the regular expression [\w\s-.]+.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Required. The id of the resource to which this reference refers. Must be the id of a resource that exists in the parent environment and is of the given resourceType.
*/
public val refers: Output
get() = javaResource.refers().applyValue({ args0 -> args0 })
/**
* The type of resource referred to by this reference. Valid values are 'KeyStore' or 'TrustStore'.
*/
public val resourceType: Output
get() = javaResource.resourceType().applyValue({ args0 -> args0 })
}
public object EnvReferencesMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.apigee.EnvReferences::class == javaResource::class
override fun map(javaResource: Resource): EnvReferences = EnvReferences(
javaResource as
com.pulumi.gcp.apigee.EnvReferences,
)
}
/**
* @see [EnvReferences].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [EnvReferences].
*/
public suspend fun envReferences(
name: String,
block: suspend EnvReferencesResourceBuilder.() -> Unit,
): EnvReferences {
val builder = EnvReferencesResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [EnvReferences].
* @param name The _unique_ name of the resulting resource.
*/
public fun envReferences(name: String): EnvReferences {
val builder = EnvReferencesResourceBuilder()
builder.name(name)
return builder.build()
}