Group Args
Manages as an Azure Container Group instance.
Example Usage
This example provisions a Basic Container.
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",
},
});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",
})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" },
},
});
});package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/containerservice"
"github.com/pulumi/pulumi-azure/sdk/v6/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
})
}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());
}
}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: testingImport
Container Group's can be imported using the resource id, e.g.
$ pulumi import azure:containerservice/group:Group containerGroup1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup1Constructors
Properties
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.
A diagnostics block as documented below. Changing this forces a new resource to be created.
A dns_config block as documented below. Changing this forces a new resource to be created.
The DNS label/name for the container group's IP. Changing this forces a new resource to be created.
The value representing the security enum. Noreuse, ResourceGroupReuse, SubscriptionReuse, TenantReuse or Unsecure. Defaults to Unsecure. Changing this forces a new resource to be created.
Zero or more exposed_port blocks as defined below. Changing this forces a new resource to be created.
An identity block as defined below.
An image_registry_credential block as documented below. Changing this forces a new resource to be created.
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.
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.
The Key Vault key URI for CMK encryption. Changing this forces a new resource to be created.
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.
The name of the resource group in which to create the Container Group. Changing this forces a new resource to be created.
Restart policy for the container group. Allowed values are Always, Never, OnFailure. Defaults to Always. Changing this forces a new resource to be created.