com.pulumi.azurenative.app.Job Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** 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.app;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.app.JobArgs;
import com.pulumi.azurenative.app.outputs.JobConfigurationResponse;
import com.pulumi.azurenative.app.outputs.JobTemplateResponse;
import com.pulumi.azurenative.app.outputs.ManagedServiceIdentityResponse;
import com.pulumi.azurenative.app.outputs.SystemDataResponse;
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;
/**
* Container App Job
* Azure REST API version: 2023-04-01-preview.
*
* Other available API versions: 2023-05-01, 2023-05-02-preview, 2023-08-01-preview, 2023-11-02-preview, 2024-02-02-preview, 2024-03-01, 2024-08-02-preview.
*
* ## Example Usage
* ### Create or Update Container Apps Job
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.app.Job;
* import com.pulumi.azurenative.app.JobArgs;
* import com.pulumi.azurenative.app.inputs.JobConfigurationArgs;
* import com.pulumi.azurenative.app.inputs.JobConfigurationManualTriggerConfigArgs;
* import com.pulumi.azurenative.app.inputs.JobTemplateArgs;
* 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 job = new Job("job", JobArgs.builder()
* .configuration(JobConfigurationArgs.builder()
* .manualTriggerConfig(JobConfigurationManualTriggerConfigArgs.builder()
* .parallelism(4)
* .replicaCompletionCount(1)
* .build())
* .replicaRetryLimit(10)
* .replicaTimeout(10)
* .triggerType("Manual")
* .build())
* .environmentId("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
* .jobName("testcontainerappsjob0")
* .location("East US")
* .resourceGroupName("rg")
* .template(JobTemplateArgs.builder()
* .containers(ContainerArgs.builder()
* .image("repo/testcontainerappsjob0:v1")
* .name("testcontainerappsjob0")
* .probes(ContainerAppProbeArgs.builder()
* .httpGet(ContainerAppProbeHttpGetArgs.builder()
* .httpHeaders(ContainerAppProbeHttpHeadersArgs.builder()
* .name("Custom-Header")
* .value("Awesome")
* .build())
* .path("/health")
* .port(8080)
* .build())
* .initialDelaySeconds(5)
* .periodSeconds(3)
* .type("Liveness")
* .build())
* .build())
* .initContainers(InitContainerArgs.builder()
* .args(
* "-c",
* "while true; do echo hello; sleep 10;done")
* .command("/bin/sh")
* .image("repo/testcontainerappsjob0:v4")
* .name("testinitcontainerAppsJob0")
* .resources(ContainerResourcesArgs.builder()
* .cpu(0.5)
* .memory("1Gi")
* .build())
* .build())
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create or Update Container Apps Job With Event Driven Trigger
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.app.Job;
* import com.pulumi.azurenative.app.JobArgs;
* import com.pulumi.azurenative.app.inputs.JobConfigurationArgs;
* import com.pulumi.azurenative.app.inputs.JobConfigurationEventTriggerConfigArgs;
* import com.pulumi.azurenative.app.inputs.JobScaleArgs;
* import com.pulumi.azurenative.app.inputs.JobTemplateArgs;
* 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 job = new Job("job", JobArgs.builder()
* .configuration(JobConfigurationArgs.builder()
* .eventTriggerConfig(JobConfigurationEventTriggerConfigArgs.builder()
* .parallelism(4)
* .replicaCompletionCount(1)
* .scale(JobScaleArgs.builder()
* .maxExecutions(5)
* .minExecutions(1)
* .pollingInterval(40)
* .rules(JobScaleRuleArgs.builder()
* .metadata(Map.of("topicName", "my-topic"))
* .name("servicebuscalingrule")
* .type("azure-servicebus")
* .build())
* .build())
* .build())
* .replicaRetryLimit(10)
* .replicaTimeout(10)
* .triggerType("Event")
* .build())
* .environmentId("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
* .jobName("testcontainerappsjob0")
* .location("East US")
* .resourceGroupName("rg")
* .template(JobTemplateArgs.builder()
* .containers(ContainerArgs.builder()
* .image("repo/testcontainerappsjob0:v1")
* .name("testcontainerappsjob0")
* .build())
* .initContainers(InitContainerArgs.builder()
* .args(
* "-c",
* "while true; do echo hello; sleep 10;done")
* .command("/bin/sh")
* .image("repo/testcontainerappsjob0:v4")
* .name("testinitcontainerAppsJob0")
* .resources(ContainerResourcesArgs.builder()
* .cpu(0.5)
* .memory("1Gi")
* .build())
* .build())
* .build())
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:app:Job testcontainerappsjob0 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}
* ```
*
*/
@ResourceType(type="azure-native:app:Job")
public class Job extends com.pulumi.resources.CustomResource {
/**
* Container Apps Job configuration properties.
*
*/
@Export(name="configuration", refs={JobConfigurationResponse.class}, tree="[0]")
private Output* @Nullable */ JobConfigurationResponse> configuration;
/**
* @return Container Apps Job configuration properties.
*
*/
public Output> configuration() {
return Codegen.optional(this.configuration);
}
/**
* Resource ID of environment.
*
*/
@Export(name="environmentId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> environmentId;
/**
* @return Resource ID of environment.
*
*/
public Output> environmentId() {
return Codegen.optional(this.environmentId);
}
/**
* The endpoint of the eventstream of the container apps job.
*
*/
@Export(name="eventStreamEndpoint", refs={String.class}, tree="[0]")
private Output eventStreamEndpoint;
/**
* @return The endpoint of the eventstream of the container apps job.
*
*/
public Output eventStreamEndpoint() {
return this.eventStreamEndpoint;
}
/**
* Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code.
*
*/
@Export(name="identity", refs={ManagedServiceIdentityResponse.class}, tree="[0]")
private Output* @Nullable */ ManagedServiceIdentityResponse> identity;
/**
* @return Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code.
*
*/
public Output> identity() {
return Codegen.optional(this.identity);
}
/**
* The geo-location where the resource lives
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The geo-location where the resource lives
*
*/
public Output location() {
return this.location;
}
/**
* The name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* Outbound IP Addresses of a container apps job.
*
*/
@Export(name="outboundIpAddresses", refs={List.class,String.class}, tree="[0,1]")
private Output> outboundIpAddresses;
/**
* @return Outbound IP Addresses of a container apps job.
*
*/
public Output> outboundIpAddresses() {
return this.outboundIpAddresses;
}
/**
* Provisioning state of the Container Apps Job.
*
*/
@Export(name="provisioningState", refs={String.class}, tree="[0]")
private Output provisioningState;
/**
* @return Provisioning state of the Container Apps Job.
*
*/
public Output provisioningState() {
return this.provisioningState;
}
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* Resource tags.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return Resource tags.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* Container Apps job definition.
*
*/
@Export(name="template", refs={JobTemplateResponse.class}, tree="[0]")
private Output* @Nullable */ JobTemplateResponse> template;
/**
* @return Container Apps job definition.
*
*/
public Output> template() {
return Codegen.optional(this.template);
}
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
public Output type() {
return this.type;
}
/**
* Workload profile name to pin for container apps job execution.
*
*/
@Export(name="workloadProfileName", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> workloadProfileName;
/**
* @return Workload profile name to pin for container apps job execution.
*
*/
public Output> workloadProfileName() {
return Codegen.optional(this.workloadProfileName);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Job(java.lang.String name) {
this(name, JobArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Job(java.lang.String name, JobArgs 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 Job(java.lang.String name, JobArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:app:Job", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Job(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:app:Job", name, null, makeResourceOptions(options, id), false);
}
private static JobArgs makeArgs(JobArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? JobArgs.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:app/v20221101preview:Job").build()),
Output.of(Alias.builder().type("azure-native:app/v20230401preview:Job").build()),
Output.of(Alias.builder().type("azure-native:app/v20230501:Job").build()),
Output.of(Alias.builder().type("azure-native:app/v20230502preview:Job").build()),
Output.of(Alias.builder().type("azure-native:app/v20230801preview:Job").build()),
Output.of(Alias.builder().type("azure-native:app/v20231102preview:Job").build()),
Output.of(Alias.builder().type("azure-native:app/v20240202preview:Job").build()),
Output.of(Alias.builder().type("azure-native:app/v20240301:Job").build()),
Output.of(Alias.builder().type("azure-native:app/v20240802preview:Job").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 Job get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Job(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy