We recommend using Azure Native.
azure.storage.AccountStaticWebsite
Explore with Pulumi AI
Manages the Static Website of an Azure Storage Account.
Example Usage
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 exampleAccount = new azure.storage.Account("example", {
name: "storageaccountname",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "GRS",
tags: {
environment: "staging",
},
});
const test = new azure.storage.AccountStaticWebsite("test", {
storageAccountId: testAzurermStorageAccount.id,
error404Document: "custom_not_found.html",
indexDocument: "custom_index.html",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_account = azure.storage.Account("example",
name="storageaccountname",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="GRS",
tags={
"environment": "staging",
})
test = azure.storage.AccountStaticWebsite("test",
storage_account_id=test_azurerm_storage_account["id"],
error404_document="custom_not_found.html",
index_document="custom_index.html")
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
"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 = storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("storageaccountname"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("GRS"),
Tags: pulumi.StringMap{
"environment": pulumi.String("staging"),
},
})
if err != nil {
return err
}
_, err = storage.NewAccountStaticWebsite(ctx, "test", &storage.AccountStaticWebsiteArgs{
StorageAccountId: pulumi.Any(testAzurermStorageAccount.Id),
Error404Document: pulumi.String("custom_not_found.html"),
IndexDocument: pulumi.String("custom_index.html"),
})
if err != nil {
return err
}
return nil
})
}
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 exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "storageaccountname",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "GRS",
Tags =
{
{ "environment", "staging" },
},
});
var test = new Azure.Storage.AccountStaticWebsite("test", new()
{
StorageAccountId = testAzurermStorageAccount.Id,
Error404Document = "custom_not_found.html",
IndexDocument = "custom_index.html",
});
});
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.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.AccountStaticWebsite;
import com.pulumi.azure.storage.AccountStaticWebsiteArgs;
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 exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("storageaccountname")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("GRS")
.tags(Map.of("environment", "staging"))
.build());
var test = new AccountStaticWebsite("test", AccountStaticWebsiteArgs.builder()
.storageAccountId(testAzurermStorageAccount.id())
.error404Document("custom_not_found.html")
.indexDocument("custom_index.html")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: storageaccountname
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: GRS
tags:
environment: staging
test:
type: azure:storage:AccountStaticWebsite
properties:
storageAccountId: ${testAzurermStorageAccount.id}
error404Document: custom_not_found.html
indexDocument: custom_index.html
Create AccountStaticWebsite Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AccountStaticWebsite(name: string, args: AccountStaticWebsiteArgs, opts?: CustomResourceOptions);
@overload
def AccountStaticWebsite(resource_name: str,
args: AccountStaticWebsiteInitArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AccountStaticWebsite(resource_name: str,
opts: Optional[ResourceOptions] = None,
storage_account_id: Optional[str] = None,
error404_document: Optional[str] = None,
index_document: Optional[str] = None)
func NewAccountStaticWebsite(ctx *Context, name string, args AccountStaticWebsiteArgs, opts ...ResourceOption) (*AccountStaticWebsite, error)
public AccountStaticWebsite(string name, AccountStaticWebsiteArgs args, CustomResourceOptions? opts = null)
public AccountStaticWebsite(String name, AccountStaticWebsiteArgs args)
public AccountStaticWebsite(String name, AccountStaticWebsiteArgs args, CustomResourceOptions options)
type: azure:storage:AccountStaticWebsite
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AccountStaticWebsiteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AccountStaticWebsiteInitArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AccountStaticWebsiteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccountStaticWebsiteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccountStaticWebsiteArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var accountStaticWebsiteResource = new Azure.Storage.AccountStaticWebsite("accountStaticWebsiteResource", new()
{
StorageAccountId = "string",
Error404Document = "string",
IndexDocument = "string",
});
example, err := storage.NewAccountStaticWebsite(ctx, "accountStaticWebsiteResource", &storage.AccountStaticWebsiteArgs{
StorageAccountId: pulumi.String("string"),
Error404Document: pulumi.String("string"),
IndexDocument: pulumi.String("string"),
})
var accountStaticWebsiteResource = new AccountStaticWebsite("accountStaticWebsiteResource", AccountStaticWebsiteArgs.builder()
.storageAccountId("string")
.error404Document("string")
.indexDocument("string")
.build());
account_static_website_resource = azure.storage.AccountStaticWebsite("accountStaticWebsiteResource",
storage_account_id="string",
error404_document="string",
index_document="string")
const accountStaticWebsiteResource = new azure.storage.AccountStaticWebsite("accountStaticWebsiteResource", {
storageAccountId: "string",
error404Document: "string",
indexDocument: "string",
});
type: azure:storage:AccountStaticWebsite
properties:
error404Document: string
indexDocument: string
storageAccountId: string
AccountStaticWebsite Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AccountStaticWebsite resource accepts the following input properties:
- Storage
Account stringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- Error404Document string
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- Index
Document string - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- Storage
Account stringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- Error404Document string
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- Index
Document string - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- storage
Account StringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- error404Document String
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- index
Document String - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- storage
Account stringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- error404Document string
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- index
Document string - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- storage_
account_ strid - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- error404_
document str - The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- index_
document str - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- storage
Account StringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- error404Document String
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- index
Document String - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
Outputs
All input properties are implicitly available as output properties. Additionally, the AccountStaticWebsite resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AccountStaticWebsite Resource
Get an existing AccountStaticWebsite resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AccountStaticWebsiteState, opts?: CustomResourceOptions): AccountStaticWebsite
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
error404_document: Optional[str] = None,
index_document: Optional[str] = None,
storage_account_id: Optional[str] = None) -> AccountStaticWebsite
func GetAccountStaticWebsite(ctx *Context, name string, id IDInput, state *AccountStaticWebsiteState, opts ...ResourceOption) (*AccountStaticWebsite, error)
public static AccountStaticWebsite Get(string name, Input<string> id, AccountStaticWebsiteState? state, CustomResourceOptions? opts = null)
public static AccountStaticWebsite get(String name, Output<String> id, AccountStaticWebsiteState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Error404Document string
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- Index
Document string - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- Storage
Account stringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- Error404Document string
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- Index
Document string - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- Storage
Account stringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- error404Document String
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- index
Document String - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- storage
Account StringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- error404Document string
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- index
Document string - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- storage
Account stringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- error404_
document str - The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- index_
document str - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- storage_
account_ strid - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
- error404Document String
- The absolute path to a custom webpage that should be used when a request is made which does not correspond to an existing file.
- index
Document String - The webpage that Azure Storage serves for requests to the root of a website or any subfolder. For example, index.html.
- storage
Account StringId - The ID of the Storage Account to set Static Website on. Changing this forces a new resource to be created.
Import
Storage Account Static Websites can be imported using the resource id
, e.g.
$ pulumi import azure:storage/accountStaticWebsite:AccountStaticWebsite mysite /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.