All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.aws.networkmanager.kotlin.Link.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.networkmanager.kotlin
import com.pulumi.aws.networkmanager.kotlin.outputs.LinkBandwidth
import com.pulumi.aws.networkmanager.kotlin.outputs.LinkBandwidth.Companion.toKotlin
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.Map
/**
* Builder for [Link].
*/
@PulumiTagMarker
public class LinkResourceBuilder internal constructor() {
public var name: String? = null
public var args: LinkArgs = LinkArgs()
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 LinkArgsBuilder.() -> Unit) {
val builder = LinkArgsBuilder()
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(): Link {
val builtJavaResource = com.pulumi.aws.networkmanager.Link(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Link(builtJavaResource)
}
}
/**
* Creates a link for a site.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.networkmanager.Link("example", {
* globalNetworkId: exampleAwsNetworkmanagerGlobalNetwork.id,
* siteId: exampleAwsNetworkmanagerSite.id,
* bandwidth: {
* uploadSpeed: 10,
* downloadSpeed: 50,
* },
* providerName: "MegaCorp",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.networkmanager.Link("example",
* global_network_id=example_aws_networkmanager_global_network["id"],
* site_id=example_aws_networkmanager_site["id"],
* bandwidth={
* "upload_speed": 10,
* "download_speed": 50,
* },
* provider_name="MegaCorp")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.NetworkManager.Link("example", new()
* {
* GlobalNetworkId = exampleAwsNetworkmanagerGlobalNetwork.Id,
* SiteId = exampleAwsNetworkmanagerSite.Id,
* Bandwidth = new Aws.NetworkManager.Inputs.LinkBandwidthArgs
* {
* UploadSpeed = 10,
* DownloadSpeed = 50,
* },
* ProviderName = "MegaCorp",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := networkmanager.NewLink(ctx, "example", &networkmanager.LinkArgs{
* GlobalNetworkId: pulumi.Any(exampleAwsNetworkmanagerGlobalNetwork.Id),
* SiteId: pulumi.Any(exampleAwsNetworkmanagerSite.Id),
* Bandwidth: &networkmanager.LinkBandwidthArgs{
* UploadSpeed: pulumi.Int(10),
* DownloadSpeed: pulumi.Int(50),
* },
* ProviderName: pulumi.String("MegaCorp"),
* })
* 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.networkmanager.Link;
* import com.pulumi.aws.networkmanager.LinkArgs;
* import com.pulumi.aws.networkmanager.inputs.LinkBandwidthArgs;
* 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 Link("example", LinkArgs.builder()
* .globalNetworkId(exampleAwsNetworkmanagerGlobalNetwork.id())
* .siteId(exampleAwsNetworkmanagerSite.id())
* .bandwidth(LinkBandwidthArgs.builder()
* .uploadSpeed(10)
* .downloadSpeed(50)
* .build())
* .providerName("MegaCorp")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:networkmanager:Link
* properties:
* globalNetworkId: ${exampleAwsNetworkmanagerGlobalNetwork.id}
* siteId: ${exampleAwsNetworkmanagerSite.id}
* bandwidth:
* uploadSpeed: 10
* downloadSpeed: 50
* providerName: MegaCorp
* ```
*
* ## Import
* Using `pulumi import`, import `aws_networkmanager_link` using the link ARN. For example:
* ```sh
* $ pulumi import aws:networkmanager/link:Link example arn:aws:networkmanager::123456789012:link/global-network-0d47f6t230mz46dy4/link-444555aaabbb11223
* ```
*/
public class Link internal constructor(
override val javaResource: com.pulumi.aws.networkmanager.Link,
) : KotlinCustomResource(javaResource, LinkMapper) {
/**
* Link Amazon Resource Name (ARN).
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The upload speed and download speed in Mbps. Documented below.
*/
public val bandwidth: Output
get() = javaResource.bandwidth().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
/**
* A description of the link.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the global network.
*/
public val globalNetworkId: Output
get() = javaResource.globalNetworkId().applyValue({ args0 -> args0 })
/**
* The provider of the link.
*/
public val providerName: Output?
get() = javaResource.providerName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the site.
*/
public val siteId: Output
get() = javaResource.siteId().applyValue({ args0 -> args0 })
/**
* Key-value tags for the link. 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>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}).orElse(null)
})
/**
* A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
*/
@Deprecated(
message = """
Please use `tags` instead.
""",
)
public val tagsAll: Output>
get() = javaResource.tagsAll().applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
})
/**
* The type of the link.
*/
public val type: Output?
get() = javaResource.type().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object LinkMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.networkmanager.Link::class == javaResource::class
override fun map(javaResource: Resource): Link = Link(
javaResource as
com.pulumi.aws.networkmanager.Link,
)
}
/**
* @see [Link].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Link].
*/
public suspend fun link(name: String, block: suspend LinkResourceBuilder.() -> Unit): Link {
val builder = LinkResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Link].
* @param name The _unique_ name of the resulting resource.
*/
public fun link(name: String): Link {
val builder = LinkResourceBuilder()
builder.name(name)
return builder.build()
}