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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.containerservice.kotlin
import com.pulumi.azure.containerservice.kotlin.outputs.GroupContainer
import com.pulumi.azure.containerservice.kotlin.outputs.GroupDiagnostics
import com.pulumi.azure.containerservice.kotlin.outputs.GroupDnsConfig
import com.pulumi.azure.containerservice.kotlin.outputs.GroupExposedPort
import com.pulumi.azure.containerservice.kotlin.outputs.GroupIdentity
import com.pulumi.azure.containerservice.kotlin.outputs.GroupImageRegistryCredential
import com.pulumi.azure.containerservice.kotlin.outputs.GroupInitContainer
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.List
import kotlin.collections.Map
import com.pulumi.azure.containerservice.kotlin.outputs.GroupContainer.Companion.toKotlin as groupContainerToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.GroupDiagnostics.Companion.toKotlin as groupDiagnosticsToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.GroupDnsConfig.Companion.toKotlin as groupDnsConfigToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.GroupExposedPort.Companion.toKotlin as groupExposedPortToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.GroupIdentity.Companion.toKotlin as groupIdentityToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.GroupImageRegistryCredential.Companion.toKotlin as groupImageRegistryCredentialToKotlin
import com.pulumi.azure.containerservice.kotlin.outputs.GroupInitContainer.Companion.toKotlin as groupInitContainerToKotlin
/**
* Builder for [Group].
*/
@PulumiTagMarker
public class GroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: GroupArgs = GroupArgs()
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 GroupArgsBuilder.() -> Unit) {
val builder = GroupArgsBuilder()
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(): Group {
val builtJavaResource = com.pulumi.azure.containerservice.Group(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Group(builtJavaResource)
}
}
/**
* Manages as an Azure Container Group instance.
* > **Note** `network_profile_id` is [deprecated](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet) by Azure. For users who want to continue to manage existing `azure.containerservice.Group` that rely on `network_profile_id`, please stay on provider versions prior to v3.16.0. Otherwise, use `subnet_ids` instead.
* ## Example Usage
* This example provisions a Basic Container.
*
* ```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 exampleGroup = new azure.containerservice.Group("example", {
* name: "example-continst",
* location: example.location,
* resourceGroupName: example.name,
* ipAddressType: "Public",
* dnsNameLabel: "aci-label",
* osType: "Linux",
* containers: [
* {
* name: "hello-world",
* image: "mcr.microsoft.com/azuredocs/aci-helloworld:latest",
* cpu: 0.5,
* memory: 1.5,
* ports: [{
* port: 443,
* protocol: "TCP",
* }],
* },
* {
* name: "sidecar",
* image: "mcr.microsoft.com/azuredocs/aci-tutorial-sidecar",
* cpu: 0.5,
* memory: 1.5,
* },
* ],
* tags: {
* environment: "testing",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_group = azure.containerservice.Group("example",
* name="example-continst",
* location=example.location,
* resource_group_name=example.name,
* ip_address_type="Public",
* dns_name_label="aci-label",
* os_type="Linux",
* containers=[
* {
* "name": "hello-world",
* "image": "mcr.microsoft.com/azuredocs/aci-helloworld:latest",
* "cpu": 0.5,
* "memory": 1.5,
* "ports": [{
* "port": 443,
* "protocol": "TCP",
* }],
* },
* {
* "name": "sidecar",
* "image": "mcr.microsoft.com/azuredocs/aci-tutorial-sidecar",
* "cpu": 0.5,
* "memory": 1.5,
* },
* ],
* tags={
* "environment": "testing",
* })
* ```
* ```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 exampleGroup = new Azure.ContainerService.Group("example", new()
* {
* Name = "example-continst",
* Location = example.Location,
* ResourceGroupName = example.Name,
* IpAddressType = "Public",
* DnsNameLabel = "aci-label",
* OsType = "Linux",
* Containers = new[]
* {
* new Azure.ContainerService.Inputs.GroupContainerArgs
* {
* Name = "hello-world",
* Image = "mcr.microsoft.com/azuredocs/aci-helloworld:latest",
* Cpu = 0.5,
* Memory = 1.5,
* Ports = new[]
* {
* new Azure.ContainerService.Inputs.GroupContainerPortArgs
* {
* Port = 443,
* Protocol = "TCP",
* },
* },
* },
* new Azure.ContainerService.Inputs.GroupContainerArgs
* {
* Name = "sidecar",
* Image = "mcr.microsoft.com/azuredocs/aci-tutorial-sidecar",
* Cpu = 0.5,
* Memory = 1.5,
* },
* },
* Tags =
* {
* { "environment", "testing" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "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 = containerservice.NewGroup(ctx, "example", &containerservice.GroupArgs{
* Name: pulumi.String("example-continst"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* IpAddressType: pulumi.String("Public"),
* DnsNameLabel: pulumi.String("aci-label"),
* OsType: pulumi.String("Linux"),
* Containers: containerservice.GroupContainerArray{
* &containerservice.GroupContainerArgs{
* Name: pulumi.String("hello-world"),
* Image: pulumi.String("mcr.microsoft.com/azuredocs/aci-helloworld:latest"),
* Cpu: pulumi.Float64(0.5),
* Memory: pulumi.Float64(1.5),
* Ports: containerservice.GroupContainerPortArray{
* &containerservice.GroupContainerPortArgs{
* Port: pulumi.Int(443),
* Protocol: pulumi.String("TCP"),
* },
* },
* },
* &containerservice.GroupContainerArgs{
* Name: pulumi.String("sidecar"),
* Image: pulumi.String("mcr.microsoft.com/azuredocs/aci-tutorial-sidecar"),
* Cpu: pulumi.Float64(0.5),
* Memory: pulumi.Float64(1.5),
* },
* },
* Tags: pulumi.StringMap{
* "environment": pulumi.String("testing"),
* },
* })
* 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.containerservice.Group;
* import com.pulumi.azure.containerservice.GroupArgs;
* import com.pulumi.azure.containerservice.inputs.GroupContainerArgs;
* 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 exampleGroup = new Group("exampleGroup", GroupArgs.builder()
* .name("example-continst")
* .location(example.location())
* .resourceGroupName(example.name())
* .ipAddressType("Public")
* .dnsNameLabel("aci-label")
* .osType("Linux")
* .containers(
* GroupContainerArgs.builder()
* .name("hello-world")
* .image("mcr.microsoft.com/azuredocs/aci-helloworld:latest")
* .cpu("0.5")
* .memory("1.5")
* .ports(GroupContainerPortArgs.builder()
* .port(443)
* .protocol("TCP")
* .build())
* .build(),
* GroupContainerArgs.builder()
* .name("sidecar")
* .image("mcr.microsoft.com/azuredocs/aci-tutorial-sidecar")
* .cpu("0.5")
* .memory("1.5")
* .build())
* .tags(Map.of("environment", "testing"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleGroup:
* type: azure:containerservice:Group
* name: example
* properties:
* name: example-continst
* location: ${example.location}
* resourceGroupName: ${example.name}
* ipAddressType: Public
* dnsNameLabel: aci-label
* osType: Linux
* containers:
* - name: hello-world
* image: mcr.microsoft.com/azuredocs/aci-helloworld:latest
* cpu: '0.5'
* memory: '1.5'
* ports:
* - port: 443
* protocol: TCP
* - name: sidecar
* image: mcr.microsoft.com/azuredocs/aci-tutorial-sidecar
* cpu: '0.5'
* memory: '1.5'
* tags:
* environment: testing
* ```
*
* ## Import
* Container Group's can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:containerservice/group:Group containerGroup1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup1
* ```
*/
public class Group internal constructor(
override val javaResource: com.pulumi.azure.containerservice.Group,
) : KotlinCustomResource(javaResource, GroupMapper) {
/**
* The definition of a container that is part of the group as documented in the `container` block below. Changing this forces a new resource to be created.
*/
public val containers: Output>
get() = javaResource.containers().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
groupContainerToKotlin(args0)
})
})
})
/**
* A `diagnostics` block as documented below. Changing this forces a new resource to be created.
*/
public val diagnostics: Output?
get() = javaResource.diagnostics().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
groupDiagnosticsToKotlin(args0)
})
}).orElse(null)
})
/**
* A `dns_config` block as documented below. Changing this forces a new resource to be created.
*/
public val dnsConfig: Output?
get() = javaResource.dnsConfig().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
groupDnsConfigToKotlin(args0)
})
}).orElse(null)
})
/**
* The DNS label/name for the container group's IP. Changing this forces a new resource to be created.
* > **Note:** DNS label/name is not supported when deploying to virtual networks.
*/
public val dnsNameLabel: Output?
get() = javaResource.dnsNameLabel().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The value representing the security enum. `Noreuse`, `ResourceGroupReuse`, `SubscriptionReuse`, `TenantReuse` or `Unsecure`. Defaults to `Unsecure`.
*/
public val dnsNameLabelReusePolicy: Output?
get() = javaResource.dnsNameLabelReusePolicy().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Zero or more `exposed_port` blocks as defined below. Changing this forces a new resource to be created.
* > **Note:** The `exposed_port` can only contain ports that are also exposed on one or more containers in the group.
*/
public val exposedPorts: Output>
get() = javaResource.exposedPorts().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
groupExposedPortToKotlin(args0)
})
})
})
/**
* The FQDN of the container group derived from `dns_name_label`.
*/
public val fqdn: Output
get() = javaResource.fqdn().applyValue({ args0 -> args0 })
/**
* An `identity` block as defined below.
*/
public val identity: Output?
get() = javaResource.identity().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
groupIdentityToKotlin(args0)
})
}).orElse(null)
})
/**
* An `image_registry_credential` block as documented below. Changing this forces a new resource to be created.
*/
public val imageRegistryCredentials: Output>?
get() = javaResource.imageRegistryCredentials().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
groupImageRegistryCredentialToKotlin(args0)
})
})
}).orElse(null)
})
/**
* The definition of an init container that is part of the group as documented in the `init_container` block below. Changing this forces a new resource to be created.
*/
public val initContainers: Output>?
get() = javaResource.initContainers().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
groupInitContainerToKotlin(args0)
})
})
}).orElse(null)
})
/**
* The IP address allocated to the container group.
*/
public val ipAddress: Output
get() = javaResource.ipAddress().applyValue({ args0 -> args0 })
/**
* Specifies the IP address type of the container. `Public`, `Private` or `None`. Changing this forces a new resource to be created. If set to `Private`, `subnet_ids` also needs to be set. Defaults to `Public`.
* > **Note:** `dns_name_label` and `os_type` set to `windows` are not compatible with `Private` `ip_address_type`
*/
public val ipAddressType: Output?
get() = javaResource.ipAddressType().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Key Vault key URI for CMK encryption. Changing this forces a new resource to be created.
*/
public val keyVaultKeyId: Output?
get() = javaResource.keyVaultKeyId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The user assigned identity that has access to the Key Vault Key. If not specified, the RP principal named "Azure Container Instance Service" will be used instead. Make sure the identity has the proper `key_permissions` set, at least with `Get`, `UnwrapKey`, `WrapKey` and `GetRotationPolicy`.
*/
public val keyVaultUserAssignedIdentityId: Output?
get() = javaResource.keyVaultUserAssignedIdentityId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* Specifies the name of the Container Group. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
@Deprecated(
message = """
the 'network_profile_id' has been removed from the latest versions of the container instance API
and has been deprecated. It no longer functions and will be removed from the 4.0 AzureRM
provider. Please use the 'subnet_ids' field instead
""",
)
public val networkProfileId: Output
get() = javaResource.networkProfileId().applyValue({ args0 -> args0 })
/**
* The OS for the container group. Allowed values are `Linux` and `Windows`. Changing this forces a new resource to be created.
* > **Note:** if `os_type` is set to `Windows` currently only a single `container` block is supported. Windows containers are not supported in virtual networks.
*/
public val osType: Output
get() = javaResource.osType().applyValue({ args0 -> args0 })
/**
* The priority of the Container Group. Possible values are `Regular` and `Spot`. Changing this forces a new resource to be created.
* > **NOTE:** When `priority` is set to `Spot`, the `ip_address_type` has to be `None`.
*/
public val priority: Output?
get() = javaResource.priority().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The name of the resource group in which to create the Container Group. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* Restart policy for the container group. Allowed values are `Always`, `Never`, `OnFailure`. Defaults to `Always`. Changing this forces a new resource to be created.
*/
public val restartPolicy: Output?
get() = javaResource.restartPolicy().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the sku of the Container Group. Possible values are `Confidential`, `Dedicated` and `Standard`. Defaults to `Standard`. Changing this forces a new resource to be created.
*/
public val sku: Output?
get() = javaResource.sku().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The subnet resource IDs for a container group. Changing this forces a new resource to be created.
*/
public val subnetIds: Output?
get() = javaResource.subnetIds().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* A mapping of tags to assign to the resource.
*/
public val tags: Output