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

com.pulumi.azurenative.containerinstance.ContainerGroup Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.containerinstance;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.containerinstance.ContainerGroupArgs;
import com.pulumi.azurenative.containerinstance.outputs.ConfidentialComputePropertiesResponse;
import com.pulumi.azurenative.containerinstance.outputs.ContainerGroupDiagnosticsResponse;
import com.pulumi.azurenative.containerinstance.outputs.ContainerGroupIdentityResponse;
import com.pulumi.azurenative.containerinstance.outputs.ContainerGroupPropertiesResponseInstanceView;
import com.pulumi.azurenative.containerinstance.outputs.ContainerGroupSubnetIdResponse;
import com.pulumi.azurenative.containerinstance.outputs.ContainerResponse;
import com.pulumi.azurenative.containerinstance.outputs.DeploymentExtensionSpecResponse;
import com.pulumi.azurenative.containerinstance.outputs.DnsConfigurationResponse;
import com.pulumi.azurenative.containerinstance.outputs.EncryptionPropertiesResponse;
import com.pulumi.azurenative.containerinstance.outputs.ImageRegistryCredentialResponse;
import com.pulumi.azurenative.containerinstance.outputs.InitContainerDefinitionResponse;
import com.pulumi.azurenative.containerinstance.outputs.IpAddressResponse;
import com.pulumi.azurenative.containerinstance.outputs.VolumeResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * A container group.
 * Azure REST API version: 2023-05-01. Prior API version in Azure Native 1.x: 2021-03-01.
 * 
 * Other available API versions: 2017-08-01-preview, 2017-12-01-preview, 2021-03-01, 2021-07-01, 2023-02-01-preview, 2024-05-01-preview.
 * 
 * ## Example Usage
 * ### ConfidentialContainerGroup
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.containerinstance.ContainerGroup;
 * import com.pulumi.azurenative.containerinstance.ContainerGroupArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ConfidentialComputePropertiesArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ContainerArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ResourceRequirementsArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ResourceRequestsArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.SecurityContextDefinitionArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.SecurityContextCapabilitiesDefinitionArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.IpAddressArgs;
 * 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 containerGroup = new ContainerGroup("containerGroup", ContainerGroupArgs.builder()
 *             .confidentialComputeProperties(ConfidentialComputePropertiesArgs.builder()
 *                 .ccePolicy("eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19")
 *                 .build())
 *             .containerGroupName("demo1")
 *             .containers(ContainerArgs.builder()
 *                 .command()
 *                 .environmentVariables()
 *                 .image("confiimage")
 *                 .name("accdemo")
 *                 .ports(ContainerPortArgs.builder()
 *                     .port(8000)
 *                     .build())
 *                 .resources(ResourceRequirementsArgs.builder()
 *                     .requests(ResourceRequestsArgs.builder()
 *                         .cpu(1)
 *                         .memoryInGB(1.5)
 *                         .build())
 *                     .build())
 *                 .securityContext(SecurityContextDefinitionArgs.builder()
 *                     .capabilities(SecurityContextCapabilitiesDefinitionArgs.builder()
 *                         .add("CAP_NET_ADMIN")
 *                         .build())
 *                     .privileged(false)
 *                     .build())
 *                 .build())
 *             .imageRegistryCredentials()
 *             .ipAddress(IpAddressArgs.builder()
 *                 .ports(PortArgs.builder()
 *                     .port(8000)
 *                     .protocol("TCP")
 *                     .build())
 *                 .type("Public")
 *                 .build())
 *             .location("westeurope")
 *             .osType("Linux")
 *             .resourceGroupName("demo")
 *             .sku("Confidential")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### ContainerGroupCreateWithExtensions * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.containerinstance.ContainerGroup;
 * import com.pulumi.azurenative.containerinstance.ContainerGroupArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ContainerArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ResourceRequirementsArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ResourceRequestsArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.DeploymentExtensionSpecArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.IpAddressArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ContainerGroupSubnetIdArgs;
 * 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 containerGroup = new ContainerGroup("containerGroup", ContainerGroupArgs.builder()
 *             .containerGroupName("demo1")
 *             .containers(ContainerArgs.builder()
 *                 .command()
 *                 .environmentVariables()
 *                 .image("nginx")
 *                 .name("demo1")
 *                 .ports(ContainerPortArgs.builder()
 *                     .port(80)
 *                     .build())
 *                 .resources(ResourceRequirementsArgs.builder()
 *                     .requests(ResourceRequestsArgs.builder()
 *                         .cpu(1)
 *                         .memoryInGB(1.5)
 *                         .build())
 *                     .build())
 *                 .build())
 *             .extensions(            
 *                 DeploymentExtensionSpecArgs.builder()
 *                     .extensionType("kube-proxy")
 *                     .name("kube-proxy")
 *                     .protectedSettings(Map.of("kubeConfig", ""))
 *                     .settings(Map.ofEntries(
 *                         Map.entry("clusterCidr", "10.240.0.0/16"),
 *                         Map.entry("kubeVersion", "v1.9.10")
 *                     ))
 *                     .version("1.0")
 *                     .build(),
 *                 DeploymentExtensionSpecArgs.builder()
 *                     .extensionType("realtime-metrics")
 *                     .name("vk-realtime-metrics")
 *                     .version("1.0")
 *                     .build())
 *             .imageRegistryCredentials()
 *             .ipAddress(IpAddressArgs.builder()
 *                 .ports(PortArgs.builder()
 *                     .port(80)
 *                     .protocol("TCP")
 *                     .build())
 *                 .type("Private")
 *                 .build())
 *             .location("eastus2")
 *             .osType("Linux")
 *             .resourceGroupName("demo")
 *             .subnetIds(ContainerGroupSubnetIdArgs.builder()
 *                 .id("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet")
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### ContainerGroupsCreateWithPriority * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.containerinstance.ContainerGroup;
 * import com.pulumi.azurenative.containerinstance.ContainerGroupArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ContainerArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ResourceRequirementsArgs;
 * import com.pulumi.azurenative.containerinstance.inputs.ResourceRequestsArgs;
 * 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 containerGroup = new ContainerGroup("containerGroup", ContainerGroupArgs.builder()
 *             .containerGroupName("demo1")
 *             .containers(ContainerArgs.builder()
 *                 .command(                
 *                     "/bin/sh",
 *                     "-c",
 *                     "sleep 10")
 *                 .image("alpine:latest")
 *                 .name("test-container-001")
 *                 .resources(ResourceRequirementsArgs.builder()
 *                     .requests(ResourceRequestsArgs.builder()
 *                         .cpu(1)
 *                         .memoryInGB(1)
 *                         .build())
 *                     .build())
 *                 .build())
 *             .location("eastus")
 *             .osType("Linux")
 *             .priority("Spot")
 *             .resourceGroupName("demo")
 *             .restartPolicy("Never")
 *             .sku("Standard")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:containerinstance:ContainerGroup demo1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName} * ``` * */ @ResourceType(type="azure-native:containerinstance:ContainerGroup") public class ContainerGroup extends com.pulumi.resources.CustomResource { /** * The properties for confidential container group * */ @Export(name="confidentialComputeProperties", refs={ConfidentialComputePropertiesResponse.class}, tree="[0]") private Output confidentialComputeProperties; /** * @return The properties for confidential container group * */ public Output> confidentialComputeProperties() { return Codegen.optional(this.confidentialComputeProperties); } /** * The containers within the container group. * */ @Export(name="containers", refs={List.class,ContainerResponse.class}, tree="[0,1]") private Output> containers; /** * @return The containers within the container group. * */ public Output> containers() { return this.containers; } /** * The diagnostic information for a container group. * */ @Export(name="diagnostics", refs={ContainerGroupDiagnosticsResponse.class}, tree="[0]") private Output diagnostics; /** * @return The diagnostic information for a container group. * */ public Output> diagnostics() { return Codegen.optional(this.diagnostics); } /** * The DNS config information for a container group. * */ @Export(name="dnsConfig", refs={DnsConfigurationResponse.class}, tree="[0]") private Output dnsConfig; /** * @return The DNS config information for a container group. * */ public Output> dnsConfig() { return Codegen.optional(this.dnsConfig); } /** * The encryption properties for a container group. * */ @Export(name="encryptionProperties", refs={EncryptionPropertiesResponse.class}, tree="[0]") private Output encryptionProperties; /** * @return The encryption properties for a container group. * */ public Output> encryptionProperties() { return Codegen.optional(this.encryptionProperties); } /** * extensions used by virtual kubelet * */ @Export(name="extensions", refs={List.class,DeploymentExtensionSpecResponse.class}, tree="[0,1]") private Output> extensions; /** * @return extensions used by virtual kubelet * */ public Output>> extensions() { return Codegen.optional(this.extensions); } /** * The identity of the container group, if configured. * */ @Export(name="identity", refs={ContainerGroupIdentityResponse.class}, tree="[0]") private Output identity; /** * @return The identity of the container group, if configured. * */ public Output> identity() { return Codegen.optional(this.identity); } /** * The image registry credentials by which the container group is created from. * */ @Export(name="imageRegistryCredentials", refs={List.class,ImageRegistryCredentialResponse.class}, tree="[0,1]") private Output> imageRegistryCredentials; /** * @return The image registry credentials by which the container group is created from. * */ public Output>> imageRegistryCredentials() { return Codegen.optional(this.imageRegistryCredentials); } /** * The init containers for a container group. * */ @Export(name="initContainers", refs={List.class,InitContainerDefinitionResponse.class}, tree="[0,1]") private Output> initContainers; /** * @return The init containers for a container group. * */ public Output>> initContainers() { return Codegen.optional(this.initContainers); } /** * The instance view of the container group. Only valid in response. * */ @Export(name="instanceView", refs={ContainerGroupPropertiesResponseInstanceView.class}, tree="[0]") private Output instanceView; /** * @return The instance view of the container group. Only valid in response. * */ public Output instanceView() { return this.instanceView; } /** * The IP address type of the container group. * */ @Export(name="ipAddress", refs={IpAddressResponse.class}, tree="[0]") private Output ipAddress; /** * @return The IP address type of the container group. * */ public Output> ipAddress() { return Codegen.optional(this.ipAddress); } /** * The resource location. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return The resource location. * */ public Output> location() { return Codegen.optional(this.location); } /** * The resource name. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The resource name. * */ public Output name() { return this.name; } /** * The operating system type required by the containers in the container group. * */ @Export(name="osType", refs={String.class}, tree="[0]") private Output osType; /** * @return The operating system type required by the containers in the container group. * */ public Output osType() { return this.osType; } /** * The priority of the container group. * */ @Export(name="priority", refs={String.class}, tree="[0]") private Output priority; /** * @return The priority of the container group. * */ public Output> priority() { return Codegen.optional(this.priority); } /** * The provisioning state of the container group. This only appears in the response. * */ @Export(name="provisioningState", refs={String.class}, tree="[0]") private Output provisioningState; /** * @return The provisioning state of the container group. This only appears in the response. * */ public Output provisioningState() { return this.provisioningState; } /** * Restart policy for all containers within the container group. * - `Always` Always restart * - `OnFailure` Restart on failure * - `Never` Never restart * */ @Export(name="restartPolicy", refs={String.class}, tree="[0]") private Output restartPolicy; /** * @return Restart policy for all containers within the container group. * - `Always` Always restart * - `OnFailure` Restart on failure * - `Never` Never restart * */ public Output> restartPolicy() { return Codegen.optional(this.restartPolicy); } /** * The SKU for a container group. * */ @Export(name="sku", refs={String.class}, tree="[0]") private Output sku; /** * @return The SKU for a container group. * */ public Output> sku() { return Codegen.optional(this.sku); } /** * The subnet resource IDs for a container group. * */ @Export(name="subnetIds", refs={List.class,ContainerGroupSubnetIdResponse.class}, tree="[0,1]") private Output> subnetIds; /** * @return The subnet resource IDs for a container group. * */ public Output>> subnetIds() { return Codegen.optional(this.subnetIds); } /** * The resource tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return The resource tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * The resource type. * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return The resource type. * */ public Output type() { return this.type; } /** * The list of volumes that can be mounted by containers in this container group. * */ @Export(name="volumes", refs={List.class,VolumeResponse.class}, tree="[0,1]") private Output> volumes; /** * @return The list of volumes that can be mounted by containers in this container group. * */ public Output>> volumes() { return Codegen.optional(this.volumes); } /** * The zones for the container group. * */ @Export(name="zones", refs={List.class,String.class}, tree="[0,1]") private Output> zones; /** * @return The zones for the container group. * */ public Output>> zones() { return Codegen.optional(this.zones); } /** * * @param name The _unique_ name of the resulting resource. */ public ContainerGroup(java.lang.String name) { this(name, ContainerGroupArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ContainerGroup(java.lang.String name, ContainerGroupArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public ContainerGroup(java.lang.String name, ContainerGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:containerinstance:ContainerGroup", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ContainerGroup(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:containerinstance:ContainerGroup", name, null, makeResourceOptions(options, id), false); } private static ContainerGroupArgs makeArgs(ContainerGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ContainerGroupArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:containerinstance/v20170801preview:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20171001preview:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20171201preview:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20180201preview:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20180401:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20180601:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20180901:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20181001:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20191201:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20201101:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20210301:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20210701:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20210901:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20211001:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20220901:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20221001preview:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20230201preview:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20230501:ContainerGroup").build()), Output.of(Alias.builder().type("azure-native:containerinstance/v20240501preview:ContainerGroup").build()) )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param options Optional settings to control the behavior of the CustomResource. */ public static ContainerGroup get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ContainerGroup(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy