All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.alicloud.dns.kotlin.Instance.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.dns.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [Instance].
 */
@PulumiTagMarker
public class InstanceResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: InstanceArgs = InstanceArgs()

    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 InstanceArgsBuilder.() -> Unit) {
        val builder = InstanceArgsBuilder()
        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(): Instance {
        val builtJavaResource = com.pulumi.alicloud.dns.Instance(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Instance(builtJavaResource)
    }
}

/**
 * Create an DNS Instance resource.
 * > **DEPRECATED:** This resource has been renamed to alicloud.dns.AlidnsInstance from version 1.95.0.
 * > **NOTE:** Available in v1.80.0+.
 * ## Example Usage
 * Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 * const _this = new alicloud.dns.Instance("this", {
 *     dnsSecurity: "no",
 *     domainNumbers: "2",
 *     period: 1,
 *     renewPeriod: 1,
 *     renewalStatus: "ManualRenewal",
 *     versionCode: "version_personal",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * this = alicloud.dns.Instance("this",
 *     dns_security="no",
 *     domain_numbers="2",
 *     period=1,
 *     renew_period=1,
 *     renewal_status="ManualRenewal",
 *     version_code="version_personal")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AliCloud = Pulumi.AliCloud;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @this = new AliCloud.Dns.Instance("this", new()
 *     {
 *         DnsSecurity = "no",
 *         DomainNumbers = "2",
 *         Period = 1,
 *         RenewPeriod = 1,
 *         RenewalStatus = "ManualRenewal",
 *         VersionCode = "version_personal",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dns"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dns.NewInstance(ctx, "this", &dns.InstanceArgs{
 * 			DnsSecurity:   pulumi.String("no"),
 * 			DomainNumbers: pulumi.String("2"),
 * 			Period:        pulumi.Int(1),
 * 			RenewPeriod:   pulumi.Int(1),
 * 			RenewalStatus: pulumi.String("ManualRenewal"),
 * 			VersionCode:   pulumi.String("version_personal"),
 * 		})
 * 		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.dns.Instance;
 * import com.pulumi.alicloud.dns.InstanceArgs;
 * 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 this_ = new Instance("this", InstanceArgs.builder()
 *             .dnsSecurity("no")
 *             .domainNumbers("2")
 *             .period(1)
 *             .renewPeriod(1)
 *             .renewalStatus("ManualRenewal")
 *             .versionCode("version_personal")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   this:
 *     type: alicloud:dns:Instance
 *     properties:
 *       dnsSecurity: no
 *       domainNumbers: '2'
 *       period: 1
 *       renewPeriod: 1
 *       renewalStatus: ManualRenewal
 *       versionCode: version_personal
 * ```
 * 
 * ## Import
 * DNS instance be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:dns/instance:Instance example dns-cn-v0h1ldjhfff
 * ```
 */
public class Instance internal constructor(
    override val javaResource: com.pulumi.alicloud.dns.Instance,
) : KotlinCustomResource(javaResource, InstanceMapper) {
    /**
     * DNS security level. Valid values: `no`, `basic`, `advanced`.
     */
    public val dnsSecurity: Output
        get() = javaResource.dnsSecurity().applyValue({ args0 -> args0 })

    /**
     * Number of domain names bound.
     */
    public val domainNumbers: Output
        get() = javaResource.domainNumbers().applyValue({ args0 -> args0 })

    public val paymentType: Output?
        get() = javaResource.paymentType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Creating a pre-paid instance, it must be set, the unit is month, please enter an integer multiple of 12 for annually paid products.
     */
    public val period: Output?
        get() = javaResource.period().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Automatic renewal period, the unit is month. When setting RenewalStatus to AutoRenewal, it must be set.
     */
    public val renewPeriod: Output?
        get() = javaResource.renewPeriod().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Automatic renewal status. Valid values: `AutoRenewal`, `ManualRenewal`, default to `ManualRenewal`.
     */
    public val renewalStatus: Output
        get() = javaResource.renewalStatus().applyValue({ args0 -> args0 })

    /**
     * Paid package version. Valid values: `version_personal`, `version_enterprise_basic`, `version_enterprise_advanced`.
     */
    public val versionCode: Output
        get() = javaResource.versionCode().applyValue({ args0 -> args0 })

    /**
     * Paid package version name.
     */
    public val versionName: Output
        get() = javaResource.versionName().applyValue({ args0 -> args0 })
}

public object InstanceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.alicloud.dns.Instance::class == javaResource::class

    override fun map(javaResource: Resource): Instance = Instance(
        javaResource as
            com.pulumi.alicloud.dns.Instance,
    )
}

/**
 * @see [Instance].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Instance].
 */
public suspend fun instance(name: String, block: suspend InstanceResourceBuilder.() -> Unit): Instance {
    val builder = InstanceResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Instance].
 * @param name The _unique_ name of the resulting resource.
 */
public fun instance(name: String): Instance {
    val builder = InstanceResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy