StaticSiteArgs

data class StaticSiteArgs(val allowConfigFileUpdates: Output<Boolean>? = null, val branch: Output<String>? = null, val buildProperties: Output<StaticSiteBuildPropertiesArgs>? = null, val enterpriseGradeCdnStatus: Output<Either<String, EnterpriseGradeCdnStatus>>? = null, val identity: Output<ManagedServiceIdentityArgs>? = null, val kind: Output<String>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val provider: Output<String>? = null, val publicNetworkAccess: Output<String>? = null, val repositoryToken: Output<String>? = null, val repositoryUrl: Output<String>? = null, val resourceGroupName: Output<String>? = null, val sku: Output<SkuDescriptionArgs>? = null, val stagingEnvironmentPolicy: Output<StagingEnvironmentPolicy>? = null, val tags: Output<Map<String, String>>? = null, val templateProperties: Output<StaticSiteTemplateOptionsArgs>? = null) : ConvertibleToJava<StaticSiteArgs>

Static Site ARM resource. Uses Azure REST API version 2024-04-01. In version 2.x of the Azure Native provider, it used API version 2022-09-01. Other available API versions: 2019-08-01, 2020-06-01, 2020-09-01, 2020-10-01, 2020-12-01, 2021-01-01, 2021-01-15, 2021-02-01, 2021-03-01, 2022-03-01, 2022-09-01, 2023-01-01, 2023-12-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native web [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or update a static site

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var staticSite = new AzureNative.Web.StaticSite("staticSite", new()
{
Branch = "master",
BuildProperties = new AzureNative.Web.Inputs.StaticSiteBuildPropertiesArgs
{
ApiLocation = "api",
AppArtifactLocation = "build",
AppLocation = "app",
},
Location = "West US 2",
Name = "testStaticSite0",
RepositoryToken = "repoToken123",
RepositoryUrl = "https://github.com/username/RepoName",
ResourceGroupName = "rg",
Sku = new AzureNative.Web.Inputs.SkuDescriptionArgs
{
Name = "Basic",
Tier = "Basic",
},
});
});
package main
import (
web "github.com/pulumi/pulumi-azure-native-sdk/web/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := web.NewStaticSite(ctx, "staticSite", &web.StaticSiteArgs{
Branch: pulumi.String("master"),
BuildProperties: &web.StaticSiteBuildPropertiesArgs{
ApiLocation: pulumi.String("api"),
AppArtifactLocation: pulumi.String("build"),
AppLocation: pulumi.String("app"),
},
Location: pulumi.String("West US 2"),
Name: pulumi.String("testStaticSite0"),
RepositoryToken: pulumi.String("repoToken123"),
RepositoryUrl: pulumi.String("https://github.com/username/RepoName"),
ResourceGroupName: pulumi.String("rg"),
Sku: &web.SkuDescriptionArgs{
Name: pulumi.String("Basic"),
Tier: pulumi.String("Basic"),
},
})
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.azurenative.web.StaticSite;
import com.pulumi.azurenative.web.StaticSiteArgs;
import com.pulumi.azurenative.web.inputs.StaticSiteBuildPropertiesArgs;
import com.pulumi.azurenative.web.inputs.SkuDescriptionArgs;
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 staticSite = new StaticSite("staticSite", StaticSiteArgs.builder()
.branch("master")
.buildProperties(StaticSiteBuildPropertiesArgs.builder()
.apiLocation("api")
.appArtifactLocation("build")
.appLocation("app")
.build())
.location("West US 2")
.name("testStaticSite0")
.repositoryToken("repoToken123")
.repositoryUrl("https://github.com/username/RepoName")
.resourceGroupName("rg")
.sku(SkuDescriptionArgs.builder()
.name("Basic")
.tier("Basic")
.build())
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:web:StaticSite testStaticSite0 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}

Constructors

Link copied to clipboard
constructor(allowConfigFileUpdates: Output<Boolean>? = null, branch: Output<String>? = null, buildProperties: Output<StaticSiteBuildPropertiesArgs>? = null, enterpriseGradeCdnStatus: Output<Either<String, EnterpriseGradeCdnStatus>>? = null, identity: Output<ManagedServiceIdentityArgs>? = null, kind: Output<String>? = null, location: Output<String>? = null, name: Output<String>? = null, provider: Output<String>? = null, publicNetworkAccess: Output<String>? = null, repositoryToken: Output<String>? = null, repositoryUrl: Output<String>? = null, resourceGroupName: Output<String>? = null, sku: Output<SkuDescriptionArgs>? = null, stagingEnvironmentPolicy: Output<StagingEnvironmentPolicy>? = null, tags: Output<Map<String, String>>? = null, templateProperties: Output<StaticSiteTemplateOptionsArgs>? = null)

Properties

Link copied to clipboard
val allowConfigFileUpdates: Output<Boolean>? = null

false if config file is locked for this static web app; otherwise, true.

Link copied to clipboard
val branch: Output<String>? = null

The target branch in the repository.

Link copied to clipboard

Build properties to configure on the repository.

Link copied to clipboard

State indicating the status of the enterprise grade CDN serving traffic to the static web app.

Link copied to clipboard

Managed service identity.

Link copied to clipboard
val kind: Output<String>? = null

Kind of resource. If the resource is an app, you can refer to https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kind_property.md#app-service-resource-kind-reference for details supported values for kind.

Link copied to clipboard
val location: Output<String>? = null

Resource Location.

Link copied to clipboard
val name: Output<String>? = null

Name of the static site to create or update.

Link copied to clipboard
val provider: Output<String>? = null

The provider that submitted the last deployment to the primary environment of the static site.

Link copied to clipboard
val publicNetworkAccess: Output<String>? = null

State indicating whether public traffic are allowed or not for a static web app. Allowed Values: 'Enabled', 'Disabled' or an empty string.

Link copied to clipboard
val repositoryToken: Output<String>? = null

A user's github repository token. This is used to setup the Github Actions workflow file and API secrets.

Link copied to clipboard
val repositoryUrl: Output<String>? = null

URL for the repository of the static site.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

Name of the resource group to which the resource belongs.

Link copied to clipboard
val sku: Output<SkuDescriptionArgs>? = null

Description of a SKU for a scalable resource.

Link copied to clipboard

State indicating whether staging environments are allowed or not allowed for a static web app.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Resource tags.

Link copied to clipboard

Template options for generating a new repository.

Functions

Link copied to clipboard
open override fun toJava(): StaticSiteArgs