com.pulumi.azure.appservice.SourceControl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** 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.azure.appservice;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.appservice.SourceControlArgs;
import com.pulumi.azure.appservice.inputs.SourceControlState;
import com.pulumi.azure.appservice.outputs.SourceControlGithubActionConfiguration;
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.Boolean;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages an App Service Web App or Function App Source Control Configuration.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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.appservice.ServicePlan;
* import com.pulumi.azure.appservice.ServicePlanArgs;
* import com.pulumi.azure.appservice.LinuxWebApp;
* import com.pulumi.azure.appservice.LinuxWebAppArgs;
* import com.pulumi.azure.appservice.inputs.LinuxWebAppSiteConfigArgs;
* import com.pulumi.azure.appservice.SourceControl;
* import com.pulumi.azure.appservice.SourceControlArgs;
* 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 exampleServicePlan = new ServicePlan("exampleServicePlan", ServicePlanArgs.builder()
* .name("example")
* .resourceGroupName(example.name())
* .location(example.location())
* .osType("Linux")
* .skuName("P1v2")
* .build());
*
* var exampleLinuxWebApp = new LinuxWebApp("exampleLinuxWebApp", LinuxWebAppArgs.builder()
* .name("example")
* .resourceGroupName(example.name())
* .location(exampleServicePlan.location())
* .servicePlanId(exampleServicePlan.id())
* .siteConfig()
* .build());
*
* var exampleSourceControl = new SourceControl("exampleSourceControl", SourceControlArgs.builder()
* .appId(exampleLinuxWebApp.id())
* .repoUrl("https://github.com/Azure-Samples/python-docs-hello-world")
* .branch("master")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* App Service Source Controls can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:appservice/sourceControl:SourceControl example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1
* ```
*
*/
@ResourceType(type="azure:appservice/sourceControl:SourceControl")
public class SourceControl extends com.pulumi.resources.CustomResource {
/**
* The ID of the Windows or Linux Web App. Changing this forces a new resource to be created.
*
* > **NOTE:** Function apps are not supported at this time.
*
*/
@Export(name="appId", refs={String.class}, tree="[0]")
private Output appId;
/**
* @return The ID of the Windows or Linux Web App. Changing this forces a new resource to be created.
*
* > **NOTE:** Function apps are not supported at this time.
*
*/
public Output appId() {
return this.appId;
}
/**
* The branch name to use for deployments. Changing this forces a new resource to be created.
*
*/
@Export(name="branch", refs={String.class}, tree="[0]")
private Output branch;
/**
* @return The branch name to use for deployments. Changing this forces a new resource to be created.
*
*/
public Output branch() {
return this.branch;
}
/**
* A `github_action_configuration` block as defined below. Changing this forces a new resource to be created.
*
*/
@Export(name="githubActionConfiguration", refs={SourceControlGithubActionConfiguration.class}, tree="[0]")
private Output* @Nullable */ SourceControlGithubActionConfiguration> githubActionConfiguration;
/**
* @return A `github_action_configuration` block as defined below. Changing this forces a new resource to be created.
*
*/
public Output> githubActionConfiguration() {
return Codegen.optional(this.githubActionConfiguration);
}
/**
* The URL for the repository. Changing this forces a new resource to be created.
*
*/
@Export(name="repoUrl", refs={String.class}, tree="[0]")
private Output repoUrl;
/**
* @return The URL for the repository. Changing this forces a new resource to be created.
*
*/
public Output repoUrl() {
return this.repoUrl;
}
/**
* Should the Deployment Rollback be enabled? Defaults to `false`. Changing this forces a new resource to be created.
*
* > **NOTE:** Azure can typically set this value automatically based on the `repo_url` value.
*
*/
@Export(name="rollbackEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> rollbackEnabled;
/**
* @return Should the Deployment Rollback be enabled? Defaults to `false`. Changing this forces a new resource to be created.
*
* > **NOTE:** Azure can typically set this value automatically based on the `repo_url` value.
*
*/
public Output> rollbackEnabled() {
return Codegen.optional(this.rollbackEnabled);
}
/**
* The SCM Type in use. This value is decoded by the service from the repository information supplied.
*
*/
@Export(name="scmType", refs={String.class}, tree="[0]")
private Output scmType;
/**
* @return The SCM Type in use. This value is decoded by the service from the repository information supplied.
*
*/
public Output scmType() {
return this.scmType;
}
/**
* Should the App use local Git configuration. Changing this forces a new resource to be created.
*
*/
@Export(name="useLocalGit", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> useLocalGit;
/**
* @return Should the App use local Git configuration. Changing this forces a new resource to be created.
*
*/
public Output> useLocalGit() {
return Codegen.optional(this.useLocalGit);
}
/**
* Should code be deployed manually. Set to `false` to enable continuous integration, such as webhooks into online repos such as GitHub. Defaults to `false`. Changing this forces a new resource to be created.
*
*/
@Export(name="useManualIntegration", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> useManualIntegration;
/**
* @return Should code be deployed manually. Set to `false` to enable continuous integration, such as webhooks into online repos such as GitHub. Defaults to `false`. Changing this forces a new resource to be created.
*
*/
public Output> useManualIntegration() {
return Codegen.optional(this.useManualIntegration);
}
/**
* The repository specified is Mercurial. Defaults to `false`. Changing this forces a new resource to be created.
*
*/
@Export(name="useMercurial", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> useMercurial;
/**
* @return The repository specified is Mercurial. Defaults to `false`. Changing this forces a new resource to be created.
*
*/
public Output> useMercurial() {
return Codegen.optional(this.useMercurial);
}
/**
* Indicates if the Slot uses a GitHub action for deployment. This value is decoded by the service from the repository information supplied.
*
*/
@Export(name="usesGithubAction", refs={Boolean.class}, tree="[0]")
private Output usesGithubAction;
/**
* @return Indicates if the Slot uses a GitHub action for deployment. This value is decoded by the service from the repository information supplied.
*
*/
public Output usesGithubAction() {
return this.usesGithubAction;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public SourceControl(java.lang.String name) {
this(name, SourceControlArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public SourceControl(java.lang.String name, SourceControlArgs 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 SourceControl(java.lang.String name, SourceControlArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:appservice/sourceControl:SourceControl", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private SourceControl(java.lang.String name, Output id, @Nullable SourceControlState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:appservice/sourceControl:SourceControl", name, state, makeResourceOptions(options, id), false);
}
private static SourceControlArgs makeArgs(SourceControlArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? SourceControlArgs.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())
.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 state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static SourceControl get(java.lang.String name, Output id, @Nullable SourceControlState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new SourceControl(name, id, state, options);
}
}