com.pulumi.alicloud.ga.kotlin.IpSetArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-alicloud-kotlin Show documentation
Show all versions of pulumi-alicloud-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.alicloud.ga.kotlin
import com.pulumi.alicloud.ga.IpSetArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a Global Accelerator (GA) Ip Set resource.
* For information about Global Accelerator (GA) Ip Set and how to use it, see [What is Ip Set](https://www.alibabacloud.com/help/en/global-accelerator/latest/api-ga-2019-11-20-createipsets).
* > **NOTE:** Available since v1.113.0.
* ## Example Usage
* Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as alicloud from "@pulumi/alicloud";
* const config = new pulumi.Config();
* const region = config.get("region") || "cn-hangzhou";
* const _default = new alicloud.ga.Accelerator("default", {
* duration: 1,
* autoUseCoupon: true,
* spec: "1",
* });
* const defaultBandwidthPackage = new alicloud.ga.BandwidthPackage("default", {
* bandwidth: 100,
* type: "Basic",
* bandwidthType: "Basic",
* paymentType: "PayAsYouGo",
* billingType: "PayBy95",
* ratio: 30,
* });
* const defaultBandwidthPackageAttachment = new alicloud.ga.BandwidthPackageAttachment("default", {
* acceleratorId: _default.id,
* bandwidthPackageId: defaultBandwidthPackage.id,
* });
* const example = new alicloud.ga.IpSet("example", {
* accelerateRegionId: region,
* bandwidth: 5,
* acceleratorId: defaultBandwidthPackageAttachment.acceleratorId,
* });
* ```
* ```python
* import pulumi
* import pulumi_alicloud as alicloud
* config = pulumi.Config()
* region = config.get("region")
* if region is None:
* region = "cn-hangzhou"
* default = alicloud.ga.Accelerator("default",
* duration=1,
* auto_use_coupon=True,
* spec="1")
* default_bandwidth_package = alicloud.ga.BandwidthPackage("default",
* bandwidth=100,
* type="Basic",
* bandwidth_type="Basic",
* payment_type="PayAsYouGo",
* billing_type="PayBy95",
* ratio=30)
* default_bandwidth_package_attachment = alicloud.ga.BandwidthPackageAttachment("default",
* accelerator_id=default.id,
* bandwidth_package_id=default_bandwidth_package.id)
* example = alicloud.ga.IpSet("example",
* accelerate_region_id=region,
* bandwidth=5,
* accelerator_id=default_bandwidth_package_attachment.accelerator_id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AliCloud = Pulumi.AliCloud;
* return await Deployment.RunAsync(() =>
* {
* var config = new Config();
* var region = config.Get("region") ?? "cn-hangzhou";
* var @default = new AliCloud.Ga.Accelerator("default", new()
* {
* Duration = 1,
* AutoUseCoupon = true,
* Spec = "1",
* });
* var defaultBandwidthPackage = new AliCloud.Ga.BandwidthPackage("default", new()
* {
* Bandwidth = 100,
* Type = "Basic",
* BandwidthType = "Basic",
* PaymentType = "PayAsYouGo",
* BillingType = "PayBy95",
* Ratio = 30,
* });
* var defaultBandwidthPackageAttachment = new AliCloud.Ga.BandwidthPackageAttachment("default", new()
* {
* AcceleratorId = @default.Id,
* BandwidthPackageId = defaultBandwidthPackage.Id,
* });
* var example = new AliCloud.Ga.IpSet("example", new()
* {
* AccelerateRegionId = region,
* Bandwidth = 5,
* AcceleratorId = defaultBandwidthPackageAttachment.AcceleratorId,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ga"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cfg := config.New(ctx, "")
* region := "cn-hangzhou"
* if param := cfg.Get("region"); param != "" {
* region = param
* }
* _, err := ga.NewAccelerator(ctx, "default", &ga.AcceleratorArgs{
* Duration: pulumi.Int(1),
* AutoUseCoupon: pulumi.Bool(true),
* Spec: pulumi.String("1"),
* })
* if err != nil {
* return err
* }
* defaultBandwidthPackage, err := ga.NewBandwidthPackage(ctx, "default", &ga.BandwidthPackageArgs{
* Bandwidth: pulumi.Int(100),
* Type: pulumi.String("Basic"),
* BandwidthType: pulumi.String("Basic"),
* PaymentType: pulumi.String("PayAsYouGo"),
* BillingType: pulumi.String("PayBy95"),
* Ratio: pulumi.Int(30),
* })
* if err != nil {
* return err
* }
* defaultBandwidthPackageAttachment, err := ga.NewBandwidthPackageAttachment(ctx, "default", &ga.BandwidthPackageAttachmentArgs{
* AcceleratorId: _default.ID(),
* BandwidthPackageId: defaultBandwidthPackage.ID(),
* })
* if err != nil {
* return err
* }
* _, err = ga.NewIpSet(ctx, "example", &ga.IpSetArgs{
* AccelerateRegionId: pulumi.String(region),
* Bandwidth: pulumi.Int(5),
* AcceleratorId: defaultBandwidthPackageAttachment.AcceleratorId,
* })
* 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.alicloud.ga.Accelerator;
* import com.pulumi.alicloud.ga.AcceleratorArgs;
* import com.pulumi.alicloud.ga.BandwidthPackage;
* import com.pulumi.alicloud.ga.BandwidthPackageArgs;
* import com.pulumi.alicloud.ga.BandwidthPackageAttachment;
* import com.pulumi.alicloud.ga.BandwidthPackageAttachmentArgs;
* import com.pulumi.alicloud.ga.IpSet;
* import com.pulumi.alicloud.ga.IpSetArgs;
* 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) {
* final var config = ctx.config();
* final var region = config.get("region").orElse("cn-hangzhou");
* var default_ = new Accelerator("default", AcceleratorArgs.builder()
* .duration(1)
* .autoUseCoupon(true)
* .spec("1")
* .build());
* var defaultBandwidthPackage = new BandwidthPackage("defaultBandwidthPackage", BandwidthPackageArgs.builder()
* .bandwidth(100)
* .type("Basic")
* .bandwidthType("Basic")
* .paymentType("PayAsYouGo")
* .billingType("PayBy95")
* .ratio(30)
* .build());
* var defaultBandwidthPackageAttachment = new BandwidthPackageAttachment("defaultBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()
* .acceleratorId(default_.id())
* .bandwidthPackageId(defaultBandwidthPackage.id())
* .build());
* var example = new IpSet("example", IpSetArgs.builder()
* .accelerateRegionId(region)
* .bandwidth("5")
* .acceleratorId(defaultBandwidthPackageAttachment.acceleratorId())
* .build());
* }
* }
* ```
* ```yaml
* configuration:
* region:
* type: string
* default: cn-hangzhou
* resources:
* default:
* type: alicloud:ga:Accelerator
* properties:
* duration: 1
* autoUseCoupon: true
* spec: '1'
* defaultBandwidthPackage:
* type: alicloud:ga:BandwidthPackage
* name: default
* properties:
* bandwidth: 100
* type: Basic
* bandwidthType: Basic
* paymentType: PayAsYouGo
* billingType: PayBy95
* ratio: 30
* defaultBandwidthPackageAttachment:
* type: alicloud:ga:BandwidthPackageAttachment
* name: default
* properties:
* acceleratorId: ${default.id}
* bandwidthPackageId: ${defaultBandwidthPackage.id}
* example:
* type: alicloud:ga:IpSet
* properties:
* accelerateRegionId: ${region}
* bandwidth: '5'
* acceleratorId: ${defaultBandwidthPackageAttachment.acceleratorId}
* ```
*
* ## Import
* Ga Ip Set can be imported using the id, e.g.
* ```sh
* $ pulumi import alicloud:ga/ipSet:IpSet example
* ```
* @property accelerateRegionId The ID of an acceleration region.
* @property acceleratorId The ID of the Global Accelerator (GA) instance.
* @property bandwidth The bandwidth allocated to the acceleration region.
* > **NOTE:** The minimum bandwidth of each accelerated region is 2Mbps. The total bandwidth of the acceleration region should be less than or equal to the bandwidth of the basic bandwidth package you purchased.
* @property ipVersion The IP protocol used by the GA instance. Default value: `IPv4`. Valid values: `IPv4`, `IPv6`, `DUAL_STACK`. **NOTE:** From version 1.220.0, `ip_version` can be set to `DUAL_STACK`.
* @property ispType The line type of the elastic IP address (EIP) in the acceleration region. Valid values: `BGP`, `BGP_PRO`.
*/
public data class IpSetArgs(
public val accelerateRegionId: Output? = null,
public val acceleratorId: Output? = null,
public val bandwidth: Output? = null,
public val ipVersion: Output? = null,
public val ispType: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.alicloud.ga.IpSetArgs =
com.pulumi.alicloud.ga.IpSetArgs.builder()
.accelerateRegionId(accelerateRegionId?.applyValue({ args0 -> args0 }))
.acceleratorId(acceleratorId?.applyValue({ args0 -> args0 }))
.bandwidth(bandwidth?.applyValue({ args0 -> args0 }))
.ipVersion(ipVersion?.applyValue({ args0 -> args0 }))
.ispType(ispType?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [IpSetArgs].
*/
@PulumiTagMarker
public class IpSetArgsBuilder internal constructor() {
private var accelerateRegionId: Output? = null
private var acceleratorId: Output? = null
private var bandwidth: Output? = null
private var ipVersion: Output? = null
private var ispType: Output? = null
/**
* @param value The ID of an acceleration region.
*/
@JvmName("rkrqmbmhfuvyqwxm")
public suspend fun accelerateRegionId(`value`: Output) {
this.accelerateRegionId = value
}
/**
* @param value The ID of the Global Accelerator (GA) instance.
*/
@JvmName("kxlygbsamjtuqgpv")
public suspend fun acceleratorId(`value`: Output) {
this.acceleratorId = value
}
/**
* @param value The bandwidth allocated to the acceleration region.
* > **NOTE:** The minimum bandwidth of each accelerated region is 2Mbps. The total bandwidth of the acceleration region should be less than or equal to the bandwidth of the basic bandwidth package you purchased.
*/
@JvmName("jjdfspwcfbteqdme")
public suspend fun bandwidth(`value`: Output) {
this.bandwidth = value
}
/**
* @param value The IP protocol used by the GA instance. Default value: `IPv4`. Valid values: `IPv4`, `IPv6`, `DUAL_STACK`. **NOTE:** From version 1.220.0, `ip_version` can be set to `DUAL_STACK`.
*/
@JvmName("tpiofculcpugbbai")
public suspend fun ipVersion(`value`: Output) {
this.ipVersion = value
}
/**
* @param value The line type of the elastic IP address (EIP) in the acceleration region. Valid values: `BGP`, `BGP_PRO`.
*/
@JvmName("udxcxocrnjyfwepy")
public suspend fun ispType(`value`: Output) {
this.ispType = value
}
/**
* @param value The ID of an acceleration region.
*/
@JvmName("ghxmgnnnexdcfycc")
public suspend fun accelerateRegionId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.accelerateRegionId = mapped
}
/**
* @param value The ID of the Global Accelerator (GA) instance.
*/
@JvmName("kqrxniiyvotxpvon")
public suspend fun acceleratorId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.acceleratorId = mapped
}
/**
* @param value The bandwidth allocated to the acceleration region.
* > **NOTE:** The minimum bandwidth of each accelerated region is 2Mbps. The total bandwidth of the acceleration region should be less than or equal to the bandwidth of the basic bandwidth package you purchased.
*/
@JvmName("iwbjdbtxiujaadmh")
public suspend fun bandwidth(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.bandwidth = mapped
}
/**
* @param value The IP protocol used by the GA instance. Default value: `IPv4`. Valid values: `IPv4`, `IPv6`, `DUAL_STACK`. **NOTE:** From version 1.220.0, `ip_version` can be set to `DUAL_STACK`.
*/
@JvmName("hkubtflunliuippp")
public suspend fun ipVersion(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipVersion = mapped
}
/**
* @param value The line type of the elastic IP address (EIP) in the acceleration region. Valid values: `BGP`, `BGP_PRO`.
*/
@JvmName("flnmmubgniymovet")
public suspend fun ispType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ispType = mapped
}
internal fun build(): IpSetArgs = IpSetArgs(
accelerateRegionId = accelerateRegionId,
acceleratorId = acceleratorId,
bandwidth = bandwidth,
ipVersion = ipVersion,
ispType = ispType,
)
}