
com.pulumi.aws.imagebuilder.kotlin.Component.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.imagebuilder.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.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
/**
* Builder for [Component].
*/
@PulumiTagMarker
public class ComponentResourceBuilder internal constructor() {
public var name: String? = null
public var args: ComponentArgs = ComponentArgs()
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 ComponentArgsBuilder.() -> Unit) {
val builder = ComponentArgsBuilder()
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(): Component {
val builtJavaResource = com.pulumi.aws.imagebuilder.Component(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Component(builtJavaResource)
}
}
/**
* Manages an Image Builder Component.
* ## Example Usage
* ### URI Document
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.imagebuilder.Component("example", {
* name: "example",
* platform: "Linux",
* uri: `s3://${exampleAwsS3Object.bucket}/${exampleAwsS3Object.key}`,
* version: "1.0.0",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.imagebuilder.Component("example",
* name="example",
* platform="Linux",
* uri=f"s3://{example_aws_s3_object['bucket']}/{example_aws_s3_object['key']}",
* version="1.0.0")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.ImageBuilder.Component("example", new()
* {
* Name = "example",
* Platform = "Linux",
* Uri = $"s3://{exampleAwsS3Object.Bucket}/{exampleAwsS3Object.Key}",
* Version = "1.0.0",
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/imagebuilder"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := imagebuilder.NewComponent(ctx, "example", &imagebuilder.ComponentArgs{
* Name: pulumi.String("example"),
* Platform: pulumi.String("Linux"),
* Uri: pulumi.Sprintf("s3://%v/%v", exampleAwsS3Object.Bucket, exampleAwsS3Object.Key),
* Version: pulumi.String("1.0.0"),
* })
* 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.aws.imagebuilder.Component;
* import com.pulumi.aws.imagebuilder.ComponentArgs;
* 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) {
* var example = new Component("example", ComponentArgs.builder()
* .name("example")
* .platform("Linux")
* .uri(String.format("s3://%s/%s", exampleAwsS3Object.bucket(),exampleAwsS3Object.key()))
* .version("1.0.0")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:imagebuilder:Component
* properties:
* name: example
* platform: Linux
* uri: s3://${exampleAwsS3Object.bucket}/${exampleAwsS3Object.key}
* version: 1.0.0
* ```
*
* ## Import
* Using `pulumi import`, import `aws_imagebuilder_components` resources using the Amazon Resource Name (ARN). For example:
* ```sh
* $ pulumi import aws:imagebuilder/component:Component example arn:aws:imagebuilder:us-east-1:123456789012:component/example/1.0.0/1
* ```
* Certain resource arguments, such as `uri`, cannot be read via the API and imported into the provider. The provider will display a difference for these arguments the first run after import if declared in the the provider configuration for an imported resource.
*/
public class Component internal constructor(
override val javaResource: com.pulumi.aws.imagebuilder.Component,
) : KotlinCustomResource(javaResource, ComponentMapper) {
/**
* (Required) Amazon Resource Name (ARN) of the component.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* Change description of the component.
*/
public val changeDescription: Output?
get() = javaResource.changeDescription().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Inline YAML string with data of the component. Exactly one of `data` and `uri` can be specified. the provider will only perform drift detection of its value when present in a configuration.
*/
public val `data`: Output
get() = javaResource.`data`().applyValue({ args0 -> args0 })
/**
* Date the component was created.
*/
public val dateCreated: Output
get() = javaResource.dateCreated().applyValue({ args0 -> args0 })
/**
* Description of the component.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Encryption status of the component.
*/
public val encrypted: Output
get() = javaResource.encrypted().applyValue({ args0 -> args0 })
/**
* Amazon Resource Name (ARN) of the Key Management Service (KMS) Key used to encrypt the component.
*/
public val kmsKeyId: Output?
get() = javaResource.kmsKeyId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Name of the component.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Owner of the component.
*/
public val owner: Output
get() = javaResource.owner().applyValue({ args0 -> args0 })
/**
* Platform of the component.
*/
public val platform: Output
get() = javaResource.platform().applyValue({ args0 -> args0 })
/**
* Whether to retain the old version when the resource is destroyed or replacement is necessary. Defaults to `false`.
*/
public val skipDestroy: Output?
get() = javaResource.skipDestroy().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Set of Operating Systems (OS) supported by the component.
*/
public val supportedOsVersions: Output>?
get() = javaResource.supportedOsVersions().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* Key-value map of resource tags for the component. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy