com.pulumi.aws.worklink.kotlin.Fleet.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-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.aws.worklink.kotlin
import com.pulumi.aws.worklink.kotlin.outputs.FleetIdentityProvider
import com.pulumi.aws.worklink.kotlin.outputs.FleetNetwork
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 com.pulumi.aws.worklink.kotlin.outputs.FleetIdentityProvider.Companion.toKotlin as fleetIdentityProviderToKotlin
import com.pulumi.aws.worklink.kotlin.outputs.FleetNetwork.Companion.toKotlin as fleetNetworkToKotlin
/**
* Builder for [Fleet].
*/
@PulumiTagMarker
public class FleetResourceBuilder internal constructor() {
public var name: String? = null
public var args: FleetArgs = FleetArgs()
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 FleetArgsBuilder.() -> Unit) {
val builder = FleetArgsBuilder()
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(): Fleet {
val builtJavaResource = com.pulumi.aws.worklink.Fleet(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Fleet(builtJavaResource)
}
}
/**
* Provides a AWS WorkLink Fleet resource.
* !> **WARNING:** The `aws.worklink.Fleet` resource has been deprecated and will be removed in a future version. Use Amazon WorkSpaces Secure Browser instead.
* ## Example Usage
* Basic usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.worklink.Fleet("example", {name: "example"});
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.worklink.Fleet("example", name="example")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.WorkLink.Fleet("example", new()
* {
* Name = "example",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/worklink"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := worklink.NewFleet(ctx, "example", &worklink.FleetArgs{
* Name: pulumi.String("example"),
* })
* 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.worklink.Fleet;
* import com.pulumi.aws.worklink.FleetArgs;
* 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 Fleet("example", FleetArgs.builder()
* .name("example")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:worklink:Fleet
* properties:
* name: example
* ```
*
* Network Configuration Usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.worklink.Fleet("example", {
* name: "example",
* network: {
* vpcId: testAwsVpc.id,
* subnetIds: [testAwsSubnet.map(__item => __item.id)],
* securityGroupIds: [test.id],
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.worklink.Fleet("example",
* name="example",
* network={
* "vpc_id": test_aws_vpc["id"],
* "subnet_ids": [[__item["id"] for __item in test_aws_subnet]],
* "security_group_ids": [test["id"]],
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.WorkLink.Fleet("example", new()
* {
* Name = "example",
* Network = new Aws.WorkLink.Inputs.FleetNetworkArgs
* {
* VpcId = testAwsVpc.Id,
* SubnetIds = new[]
* {
* testAwsSubnet.Select(__item => __item.Id).ToList(),
* },
* SecurityGroupIds = new[]
* {
* test.Id,
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/worklink"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := worklink.NewFleet(ctx, "example", &worklink.FleetArgs{
* Name: pulumi.String("example"),
* Network: &worklink.FleetNetworkArgs{
* VpcId: pulumi.Any(testAwsVpc.Id),
* SubnetIds: pulumi.StringArray{
* pulumi.String(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:4,25-44)),
* },
* SecurityGroupIds: pulumi.StringArray{
* test.Id,
* },
* },
* })
* 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.worklink.Fleet;
* import com.pulumi.aws.worklink.FleetArgs;
* import com.pulumi.aws.worklink.inputs.FleetNetworkArgs;
* 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 Fleet("example", FleetArgs.builder()
* .name("example")
* .network(FleetNetworkArgs.builder()
* .vpcId(testAwsVpc.id())
* .subnetIds(testAwsSubnet.stream().map(element -> element.id()).collect(toList()))
* .securityGroupIds(test.id())
* .build())
* .build());
* }
* }
* ```
*
* Identity Provider Configuration Usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
* const test = new aws.worklink.Fleet("test", {
* name: "tf-worklink-fleet",
* identityProvider: {
* type: "SAML",
* samlMetadata: std.file({
* input: "saml-metadata.xml",
* }).then(invoke => invoke.result),
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* import pulumi_std as std
* test = aws.worklink.Fleet("test",
* name="tf-worklink-fleet",
* identity_provider={
* "type": "SAML",
* "saml_metadata": std.file(input="saml-metadata.xml").result,
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var test = new Aws.WorkLink.Fleet("test", new()
* {
* Name = "tf-worklink-fleet",
* IdentityProvider = new Aws.WorkLink.Inputs.FleetIdentityProviderArgs
* {
* Type = "SAML",
* SamlMetadata = Std.File.Invoke(new()
* {
* Input = "saml-metadata.xml",
* }).Apply(invoke => invoke.Result),
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/worklink"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* invokeFile, err := std.File(ctx, &std.FileArgs{
* Input: "saml-metadata.xml",
* }, nil)
* if err != nil {
* return err
* }
* _, err = worklink.NewFleet(ctx, "test", &worklink.FleetArgs{
* Name: pulumi.String("tf-worklink-fleet"),
* IdentityProvider: &worklink.FleetIdentityProviderArgs{
* Type: pulumi.String("SAML"),
* SamlMetadata: pulumi.String(invokeFile.Result),
* },
* })
* 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.worklink.Fleet;
* import com.pulumi.aws.worklink.FleetArgs;
* import com.pulumi.aws.worklink.inputs.FleetIdentityProviderArgs;
* 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 test = new Fleet("test", FleetArgs.builder()
* .name("tf-worklink-fleet")
* .identityProvider(FleetIdentityProviderArgs.builder()
* .type("SAML")
* .samlMetadata(StdFunctions.file(FileArgs.builder()
* .input("saml-metadata.xml")
* .build()).result())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: aws:worklink:Fleet
* properties:
* name: tf-worklink-fleet
* identityProvider:
* type: SAML
* samlMetadata:
* fn::invoke:
* Function: std:file
* Arguments:
* input: saml-metadata.xml
* Return: result
* ```
*
* ## Import
* Using `pulumi import`, import WorkLink using the ARN. For example:
* ```sh
* $ pulumi import aws:worklink/fleet:Fleet test arn:aws:worklink::123456789012:fleet/example
* ```
*/
public class Fleet internal constructor(
override val javaResource: com.pulumi.aws.worklink.Fleet,
) : KotlinCustomResource(javaResource, FleetMapper) {
/**
* The ARN of the created WorkLink Fleet.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The ARN of the Amazon Kinesis data stream that receives the audit events. Kinesis data stream name must begin with `"AmazonWorkLink-"`.
*/
public val auditStreamArn: Output?
get() = javaResource.auditStreamArn().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The identifier used by users to sign in to the Amazon WorkLink app.
*/
public val companyCode: Output
get() = javaResource.companyCode().applyValue({ args0 -> args0 })
/**
* The time that the fleet was created.
*/
public val createdTime: Output
get() = javaResource.createdTime().applyValue({ args0 -> args0 })
/**
* The certificate chain, including intermediate certificates and the root certificate authority certificate used to issue device certificates.
*/
public val deviceCaCertificate: Output?
get() = javaResource.deviceCaCertificate().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the fleet.
*/
public val displayName: Output?
get() = javaResource.displayName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Provide this to allow manage the identity provider configuration for the fleet. Fields documented below.
*/
public val identityProvider: Output?
get() = javaResource.identityProvider().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> fleetIdentityProviderToKotlin(args0) })
}).orElse(null)
})
/**
* The time that the fleet was last updated.
*/
public val lastUpdatedTime: Output
get() = javaResource.lastUpdatedTime().applyValue({ args0 -> args0 })
/**
* A region-unique name for the AMI.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Provide this to allow manage the company network configuration for the fleet. Fields documented below.
*/
public val network: Output?
get() = javaResource.network().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
fleetNetworkToKotlin(args0)
})
}).orElse(null)
})
/**
* The option to optimize for better performance by routing traffic through the closest AWS Region to users, which may be outside of your home Region. Defaults to `true`.
* **network** requires the following:
* > **NOTE:** `network` is cannot removed without force recreating.
*/
public val optimizeForEndUserLocation: Output?
get() = javaResource.optimizeForEndUserLocation().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object FleetMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.worklink.Fleet::class == javaResource::class
override fun map(javaResource: Resource): Fleet = Fleet(
javaResource as
com.pulumi.aws.worklink.Fleet,
)
}
/**
* @see [Fleet].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Fleet].
*/
public suspend fun fleet(name: String, block: suspend FleetResourceBuilder.() -> Unit): Fleet {
val builder = FleetResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Fleet].
* @param name The _unique_ name of the resulting resource.
*/
public fun fleet(name: String): Fleet {
val builder = FleetResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy