com.pulumi.awsnative.vpclattice.kotlin.Service.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.vpclattice.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.vpclattice.kotlin.enums.ServiceAuthType
import com.pulumi.awsnative.vpclattice.kotlin.enums.ServiceStatus
import com.pulumi.awsnative.vpclattice.kotlin.outputs.ServiceDnsEntry
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
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.enums.ServiceAuthType.Companion.toKotlin as serviceAuthTypeToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.enums.ServiceStatus.Companion.toKotlin as serviceStatusToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.outputs.ServiceDnsEntry.Companion.toKotlin as serviceDnsEntryToKotlin
/**
* Builder for [Service].
*/
@PulumiTagMarker
public class ServiceResourceBuilder internal constructor() {
public var name: String? = null
public var args: ServiceArgs = ServiceArgs()
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 ServiceArgsBuilder.() -> Unit) {
val builder = ServiceArgsBuilder()
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(): Service {
val builtJavaResource = com.pulumi.awsnative.vpclattice.Service(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Service(builtJavaResource)
}
}
/**
* A service is any software application that can run on instances containers, or serverless functions within an account or virtual private cloud (VPC).
*/
public class Service internal constructor(
override val javaResource: com.pulumi.awsnative.vpclattice.Service,
) : KotlinCustomResource(javaResource, ServiceMapper) {
/**
* The Amazon Resource Name (ARN) of the service.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The type of IAM policy.
* - `NONE` : The resource does not use an IAM policy. This is the default.
* - `AWS_IAM` : The resource uses an IAM policy. When this type is used, auth is enabled and an auth policy is required.
*/
public val authType: Output?
get() = javaResource.authType().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
serviceAuthTypeToKotlin(args0)
})
}).orElse(null)
})
/**
* The ID of the service.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* The Amazon Resource Name (ARN) of the certificate.
*/
public val certificateArn: Output?
get() = javaResource.certificateArn().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The date and time that the service was created, specified in ISO-8601 format.
*/
public val createdAt: Output
get() = javaResource.createdAt().applyValue({ args0 -> args0 })
/**
* The custom domain name of the service.
*/
public val customDomainName: Output?
get() = javaResource.customDomainName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The DNS information of the service.
*/
public val dnsEntry: Output?
get() = javaResource.dnsEntry().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
serviceDnsEntryToKotlin(args0)
})
}).orElse(null)
})
/**
* The date and time that the service was last updated, specified in ISO-8601 format.
*/
public val lastUpdatedAt: Output
get() = javaResource.lastUpdatedAt().applyValue({ args0 -> args0 })
/**
* The name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
* If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.
*/
public val name: Output?
get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The status of the service.
*/
public val status: Output
get() = javaResource.status().applyValue({ args0 ->
args0.let({ args0 ->
serviceStatusToKotlin(args0)
})
})
/**
* The tags for the service.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object ServiceMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.vpclattice.Service::class == javaResource::class
override fun map(javaResource: Resource): Service = Service(
javaResource as
com.pulumi.awsnative.vpclattice.Service,
)
}
/**
* @see [Service].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Service].
*/
public suspend fun service(name: String, block: suspend ServiceResourceBuilder.() -> Unit): Service {
val builder = ServiceResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Service].
* @param name The _unique_ name of the resulting resource.
*/
public fun service(name: String): Service {
val builder = ServiceResourceBuilder()
builder.name(name)
return builder.build()
}