com.pulumi.awsnative.aps.kotlin.Scraper.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.aps.kotlin
import com.pulumi.awsnative.aps.kotlin.outputs.ScraperDestination
import com.pulumi.awsnative.aps.kotlin.outputs.ScraperScrapeConfiguration
import com.pulumi.awsnative.aps.kotlin.outputs.ScraperSource
import com.pulumi.awsnative.kotlin.outputs.Tag
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.aps.kotlin.outputs.ScraperDestination.Companion.toKotlin as scraperDestinationToKotlin
import com.pulumi.awsnative.aps.kotlin.outputs.ScraperScrapeConfiguration.Companion.toKotlin as scraperScrapeConfigurationToKotlin
import com.pulumi.awsnative.aps.kotlin.outputs.ScraperSource.Companion.toKotlin as scraperSourceToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [Scraper].
*/
@PulumiTagMarker
public class ScraperResourceBuilder internal constructor() {
public var name: String? = null
public var args: ScraperArgs = ScraperArgs()
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 ScraperArgsBuilder.() -> Unit) {
val builder = ScraperArgsBuilder()
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(): Scraper {
val builtJavaResource = com.pulumi.awsnative.aps.Scraper(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Scraper(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::APS::Scraper
*/
public class Scraper internal constructor(
override val javaResource: com.pulumi.awsnative.aps.Scraper,
) : KotlinCustomResource(javaResource, ScraperMapper) {
/**
* Scraper alias.
*/
public val alias: Output?
get() = javaResource.alias().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Scraper ARN.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.
*/
public val destination: Output
get() = javaResource.destination().applyValue({ args0 ->
args0.let({ args0 ->
scraperDestinationToKotlin(args0)
})
})
/**
* IAM role ARN for the scraper.
*/
public val roleArn: Output
get() = javaResource.roleArn().applyValue({ args0 -> args0 })
/**
* The configuration in use by the scraper.
*/
public val scrapeConfiguration: Output
get() = javaResource.scrapeConfiguration().applyValue({ args0 ->
args0.let({ args0 ->
scraperScrapeConfigurationToKotlin(args0)
})
})
/**
* Required to identify a specific scraper.
*/
public val scraperId: Output
get() = javaResource.scraperId().applyValue({ args0 -> args0 })
/**
* The Amazon EKS cluster from which the scraper collects metrics.
*/
public val source: Output
get() = javaResource.source().applyValue({ args0 ->
args0.let({ args0 ->
scraperSourceToKotlin(args0)
})
})
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object ScraperMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.aps.Scraper::class == javaResource::class
override fun map(javaResource: Resource): Scraper = Scraper(
javaResource as
com.pulumi.awsnative.aps.Scraper,
)
}
/**
* @see [Scraper].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Scraper].
*/
public suspend fun scraper(name: String, block: suspend ScraperResourceBuilder.() -> Unit): Scraper {
val builder = ScraperResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Scraper].
* @param name The _unique_ name of the resulting resource.
*/
public fun scraper(name: String): Scraper {
val builder = ScraperResourceBuilder()
builder.name(name)
return builder.build()
}