![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.dns.kotlin.Zone.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-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.azure.dns.kotlin
import com.pulumi.azure.dns.kotlin.outputs.ZoneSoaRecord
import com.pulumi.azure.dns.kotlin.outputs.ZoneSoaRecord.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
/**
* Builder for [Zone].
*/
@PulumiTagMarker
public class ZoneResourceBuilder internal constructor() {
public var name: String? = null
public var args: ZoneArgs = ZoneArgs()
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 ZoneArgsBuilder.() -> Unit) {
val builder = ZoneArgsBuilder()
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(): Zone {
val builtJavaResource = com.pulumi.azure.dns.Zone(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Zone(builtJavaResource)
}
}
/**
* Enables you to manage DNS zones within Azure DNS. These zones are hosted on Azure's name servers to which you can delegate the zone from the parent domain.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const example_public = new azure.dns.Zone("example-public", {
* name: "mydomain.com",
* resourceGroupName: example.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_public = azure.dns.Zone("example-public",
* name="mydomain.com",
* resource_group_name=example.name)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var example_public = new Azure.Dns.Zone("example-public", new()
* {
* Name = "mydomain.com",
* ResourceGroupName = example.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* _, err = dns.NewZone(ctx, "example-public", &dns.ZoneArgs{
* Name: pulumi.String("mydomain.com"),
* ResourceGroupName: example.Name,
* })
* 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.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.dns.Zone;
* import com.pulumi.azure.dns.ZoneArgs;
* 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 ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* var example_public = new Zone("example-public", ZoneArgs.builder()
* .name("mydomain.com")
* .resourceGroupName(example.name())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* example-public:
* type: azure:dns:Zone
* properties:
* name: mydomain.com
* resourceGroupName: ${example.name}
* ```
*
* ## Import
* DNS Zones can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:dns/zone:Zone zone1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/dnsZones/zone1
* ```
*/
public class Zone internal constructor(
override val javaResource: com.pulumi.azure.dns.Zone,
) : KotlinCustomResource(javaResource, ZoneMapper) {
/**
* (Optional) Maximum number of Records in the zone. Defaults to `1000`.
*/
public val maxNumberOfRecordSets: Output
get() = javaResource.maxNumberOfRecordSets().applyValue({ args0 -> args0 })
/**
* The name of the DNS Zone. Must be a valid domain name. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* (Optional) A list of values that make up the NS record for the zone.
*/
public val nameServers: Output>
get() = javaResource.nameServers().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* (Optional) The number of records already in the zone.
*/
public val numberOfRecordSets: Output
get() = javaResource.numberOfRecordSets().applyValue({ args0 -> args0 })
/**
* Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* An `soa_record` block as defined below.
*/
public val soaRecord: Output
get() = javaResource.soaRecord().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
/**
* A mapping of tags to assign to the resource.
*/
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy