ibm.CosBucketWebsiteConfiguration
Explore with Pulumi AI
Provides an Static web hosting configuration resource. This resource is used to configure the website to use your documents as an index for the site and to potentially display errors.It can also be used to configure more advanced options including routing rules and request redirect for your domain.For more information about static web hosting please refer Static web hsoting with COS To configure a website_redirect for an object please refer ibm_cos_bucket_object.
Note: Enabling public access to the COS bucket required to access the hosted website.Granting public access to this bucket will allow anyone to access the bucket.
Additional Examples
Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.CosBucketWebsiteConfiguration;
import com.pulumi.ibm.CosBucketWebsiteConfigurationArgs;
import com.pulumi.ibm.inputs.CosBucketWebsiteConfigurationWebsiteConfigurationArgs;
import com.pulumi.ibm.inputs.CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs;
import com.pulumi.ibm.inputs.CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs;
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) {
// To redirect all the incoming redirect requests
var website = new CosBucketWebsiteConfiguration("website", CosBucketWebsiteConfigurationArgs.builder()
.bucketCrn("bucket_crn")
.bucketLocation(data.ibm_cos_bucket().cos_bucket_website_configuration().regional_location())
.websiteConfiguration(CosBucketWebsiteConfigurationWebsiteConfigurationArgs.builder()
.errorDocument(CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs.builder()
.key("error.html")
.build())
.indexDocument(CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs.builder()
.suffix("index.html")
.build())
.routingRules(Map.ofEntries(
Map.entry("condition", Map.of("keyPrefixEquals", "pages/")),
Map.entry("redirect", Map.of("replaceKeyPrefixWith", "web_pages/"))
))
.build())
.build());
}
}
resources:
# To redirect all the incoming redirect requests
website:
type: ibm:CosBucketWebsiteConfiguration
properties:
bucketCrn: bucket_crn
bucketLocation: ${data.ibm_cos_bucket.cos_bucket_website_configuration.regional_location}
websiteConfiguration:
errorDocument:
key: error.html
indexDocument:
suffix: index.html
routingRules:
- condition:
keyPrefixEquals: pages/
redirect:
replaceKeyPrefixWith: web_pages/
Adding website configuration with routing_rules configured.
Routing rules can also be configured using the routing_rules
argument as shown in the example:
Additional Examples
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
// To redirect all the incoming redirect requests
const website = new ibm.CosBucketWebsiteConfiguration("website", {
bucketCrn: "bucket_crn",
bucketLocation: data.ibm_cos_bucket.cos_bucket_website_configuration.regional_location,
websiteConfiguration: {
errorDocument: {
key: "error.html",
},
indexDocument: {
suffix: "index.html",
},
routingRules: ` [{
"Condition": {
"KeyPrefixEquals": "pages/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "web_pages/"
}
}]
`,
},
});
import pulumi
import pulumi_ibm as ibm
# To redirect all the incoming redirect requests
website = ibm.CosBucketWebsiteConfiguration("website",
bucket_crn="bucket_crn",
bucket_location=data["ibm_cos_bucket"]["cos_bucket_website_configuration"]["regional_location"],
website_configuration={
"error_document": {
"key": "error.html",
},
"index_document": {
"suffix": "index.html",
},
"routing_rules": """ [{
"Condition": {
"KeyPrefixEquals": "pages/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "web_pages/"
}
}]
""",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// To redirect all the incoming redirect requests
_, err := ibm.NewCosBucketWebsiteConfiguration(ctx, "website", &ibm.CosBucketWebsiteConfigurationArgs{
BucketCrn: pulumi.String("bucket_crn"),
BucketLocation: pulumi.Any(data.Ibm_cos_bucket.Cos_bucket_website_configuration.Regional_location),
WebsiteConfiguration: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationArgs{
ErrorDocument: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs{
Key: pulumi.String("error.html"),
},
IndexDocument: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs{
Suffix: pulumi.String("index.html"),
},
RoutingRules: pulumi.String(` [{
"Condition": {
"KeyPrefixEquals": "pages/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "web_pages/"
}
}]
`),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
// To redirect all the incoming redirect requests
var website = new Ibm.CosBucketWebsiteConfiguration("website", new()
{
BucketCrn = "bucket_crn",
BucketLocation = data.Ibm_cos_bucket.Cos_bucket_website_configuration.Regional_location,
WebsiteConfiguration = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationArgs
{
ErrorDocument = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs
{
Key = "error.html",
},
IndexDocument = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs
{
Suffix = "index.html",
},
RoutingRules = @" [{
""Condition"": {
""KeyPrefixEquals"": ""pages/""
},
""Redirect"": {
""ReplaceKeyPrefixWith"": ""web_pages/""
}
}]
",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.CosBucketWebsiteConfiguration;
import com.pulumi.ibm.CosBucketWebsiteConfigurationArgs;
import com.pulumi.ibm.inputs.CosBucketWebsiteConfigurationWebsiteConfigurationArgs;
import com.pulumi.ibm.inputs.CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs;
import com.pulumi.ibm.inputs.CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs;
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) {
// To redirect all the incoming redirect requests
var website = new CosBucketWebsiteConfiguration("website", CosBucketWebsiteConfigurationArgs.builder()
.bucketCrn("bucket_crn")
.bucketLocation(data.ibm_cos_bucket().cos_bucket_website_configuration().regional_location())
.websiteConfiguration(CosBucketWebsiteConfigurationWebsiteConfigurationArgs.builder()
.errorDocument(CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs.builder()
.key("error.html")
.build())
.indexDocument(CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs.builder()
.suffix("index.html")
.build())
.routingRules("""
[{
"Condition": {
"KeyPrefixEquals": "pages/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "web_pages/"
}
}]
""")
.build())
.build());
}
}
resources:
# To redirect all the incoming redirect requests
website:
type: ibm:CosBucketWebsiteConfiguration
properties:
bucketCrn: bucket_crn
bucketLocation: ${data.ibm_cos_bucket.cos_bucket_website_configuration.regional_location}
websiteConfiguration:
errorDocument:
key: error.html
indexDocument:
suffix: index.html
routingRules: |2
[{
"Condition": {
"KeyPrefixEquals": "pages/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "web_pages/"
}
}]
Create CosBucketWebsiteConfiguration Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CosBucketWebsiteConfiguration(name: string, args: CosBucketWebsiteConfigurationArgs, opts?: CustomResourceOptions);
@overload
def CosBucketWebsiteConfiguration(resource_name: str,
args: CosBucketWebsiteConfigurationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CosBucketWebsiteConfiguration(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket_crn: Optional[str] = None,
bucket_location: Optional[str] = None,
website_configuration: Optional[CosBucketWebsiteConfigurationWebsiteConfigurationArgs] = None,
cos_bucket_website_configuration_id: Optional[str] = None,
endpoint_type: Optional[str] = None,
timeouts: Optional[CosBucketWebsiteConfigurationTimeoutsArgs] = None)
func NewCosBucketWebsiteConfiguration(ctx *Context, name string, args CosBucketWebsiteConfigurationArgs, opts ...ResourceOption) (*CosBucketWebsiteConfiguration, error)
public CosBucketWebsiteConfiguration(string name, CosBucketWebsiteConfigurationArgs args, CustomResourceOptions? opts = null)
public CosBucketWebsiteConfiguration(String name, CosBucketWebsiteConfigurationArgs args)
public CosBucketWebsiteConfiguration(String name, CosBucketWebsiteConfigurationArgs args, CustomResourceOptions options)
type: ibm:CosBucketWebsiteConfiguration
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 CosBucketWebsiteConfigurationArgs
- 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 CosBucketWebsiteConfigurationArgs
- 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 CosBucketWebsiteConfigurationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CosBucketWebsiteConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CosBucketWebsiteConfigurationArgs
- 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 cosBucketWebsiteConfigurationResource = new Ibm.CosBucketWebsiteConfiguration("cosBucketWebsiteConfigurationResource", new()
{
BucketCrn = "string",
BucketLocation = "string",
WebsiteConfiguration = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationArgs
{
ErrorDocument = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs
{
Key = "string",
},
IndexDocument = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs
{
Suffix = "string",
},
RedirectAllRequestsTo = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationRedirectAllRequestsToArgs
{
HostName = "string",
Protocol = "string",
},
RoutingRule = new[]
{
new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleArgs
{
Redirect = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleRedirectArgs
{
HostName = "string",
HttpRedirectCode = "string",
Protocol = "string",
ReplaceKeyPrefixWith = "string",
ReplaceKeyWith = "string",
},
Condition = new Ibm.Inputs.CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleConditionArgs
{
HttpErrorCodeReturnedEquals = "string",
KeyPrefixEquals = "string",
},
},
},
RoutingRules = "string",
},
CosBucketWebsiteConfigurationId = "string",
EndpointType = "string",
Timeouts = new Ibm.Inputs.CosBucketWebsiteConfigurationTimeoutsArgs
{
Create = "string",
Delete = "string",
Update = "string",
},
});
example, err := ibm.NewCosBucketWebsiteConfiguration(ctx, "cosBucketWebsiteConfigurationResource", &ibm.CosBucketWebsiteConfigurationArgs{
BucketCrn: pulumi.String("string"),
BucketLocation: pulumi.String("string"),
WebsiteConfiguration: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationArgs{
ErrorDocument: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs{
Key: pulumi.String("string"),
},
IndexDocument: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs{
Suffix: pulumi.String("string"),
},
RedirectAllRequestsTo: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationRedirectAllRequestsToArgs{
HostName: pulumi.String("string"),
Protocol: pulumi.String("string"),
},
RoutingRule: ibm.CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleArray{
&ibm.CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleArgs{
Redirect: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleRedirectArgs{
HostName: pulumi.String("string"),
HttpRedirectCode: pulumi.String("string"),
Protocol: pulumi.String("string"),
ReplaceKeyPrefixWith: pulumi.String("string"),
ReplaceKeyWith: pulumi.String("string"),
},
Condition: &ibm.CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleConditionArgs{
HttpErrorCodeReturnedEquals: pulumi.String("string"),
KeyPrefixEquals: pulumi.String("string"),
},
},
},
RoutingRules: pulumi.String("string"),
},
CosBucketWebsiteConfigurationId: pulumi.String("string"),
EndpointType: pulumi.String("string"),
Timeouts: &ibm.CosBucketWebsiteConfigurationTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var cosBucketWebsiteConfigurationResource = new CosBucketWebsiteConfiguration("cosBucketWebsiteConfigurationResource", CosBucketWebsiteConfigurationArgs.builder()
.bucketCrn("string")
.bucketLocation("string")
.websiteConfiguration(CosBucketWebsiteConfigurationWebsiteConfigurationArgs.builder()
.errorDocument(CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs.builder()
.key("string")
.build())
.indexDocument(CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs.builder()
.suffix("string")
.build())
.redirectAllRequestsTo(CosBucketWebsiteConfigurationWebsiteConfigurationRedirectAllRequestsToArgs.builder()
.hostName("string")
.protocol("string")
.build())
.routingRule(CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleArgs.builder()
.redirect(CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleRedirectArgs.builder()
.hostName("string")
.httpRedirectCode("string")
.protocol("string")
.replaceKeyPrefixWith("string")
.replaceKeyWith("string")
.build())
.condition(CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleConditionArgs.builder()
.httpErrorCodeReturnedEquals("string")
.keyPrefixEquals("string")
.build())
.build())
.routingRules("string")
.build())
.cosBucketWebsiteConfigurationId("string")
.endpointType("string")
.timeouts(CosBucketWebsiteConfigurationTimeoutsArgs.builder()
.create("string")
.delete("string")
.update("string")
.build())
.build());
cos_bucket_website_configuration_resource = ibm.CosBucketWebsiteConfiguration("cosBucketWebsiteConfigurationResource",
bucket_crn="string",
bucket_location="string",
website_configuration={
"error_document": {
"key": "string",
},
"index_document": {
"suffix": "string",
},
"redirect_all_requests_to": {
"host_name": "string",
"protocol": "string",
},
"routing_rule": [{
"redirect": {
"host_name": "string",
"http_redirect_code": "string",
"protocol": "string",
"replace_key_prefix_with": "string",
"replace_key_with": "string",
},
"condition": {
"http_error_code_returned_equals": "string",
"key_prefix_equals": "string",
},
}],
"routing_rules": "string",
},
cos_bucket_website_configuration_id="string",
endpoint_type="string",
timeouts={
"create": "string",
"delete": "string",
"update": "string",
})
const cosBucketWebsiteConfigurationResource = new ibm.CosBucketWebsiteConfiguration("cosBucketWebsiteConfigurationResource", {
bucketCrn: "string",
bucketLocation: "string",
websiteConfiguration: {
errorDocument: {
key: "string",
},
indexDocument: {
suffix: "string",
},
redirectAllRequestsTo: {
hostName: "string",
protocol: "string",
},
routingRule: [{
redirect: {
hostName: "string",
httpRedirectCode: "string",
protocol: "string",
replaceKeyPrefixWith: "string",
replaceKeyWith: "string",
},
condition: {
httpErrorCodeReturnedEquals: "string",
keyPrefixEquals: "string",
},
}],
routingRules: "string",
},
cosBucketWebsiteConfigurationId: "string",
endpointType: "string",
timeouts: {
create: "string",
"delete": "string",
update: "string",
},
});
type: ibm:CosBucketWebsiteConfiguration
properties:
bucketCrn: string
bucketLocation: string
cosBucketWebsiteConfigurationId: string
endpointType: string
timeouts:
create: string
delete: string
update: string
websiteConfiguration:
errorDocument:
key: string
indexDocument:
suffix: string
redirectAllRequestsTo:
hostName: string
protocol: string
routingRule:
- condition:
httpErrorCodeReturnedEquals: string
keyPrefixEquals: string
redirect:
hostName: string
httpRedirectCode: string
protocol: string
replaceKeyPrefixWith: string
replaceKeyWith: string
routingRules: string
CosBucketWebsiteConfiguration 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 CosBucketWebsiteConfiguration resource accepts the following input properties:
- Bucket
Crn string - The CRN of the COS bucket.
- Bucket
Location string - The location of the COS bucket.
- Website
Configuration CosBucket Website Configuration Website Configuration Nested block have the following structure:
Nested scheme for
website_configuration
:- Cos
Bucket stringWebsite Configuration Id - (String) The ID of the bucket.
- Endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - Timeouts
Cos
Bucket Website Configuration Timeouts
- Bucket
Crn string - The CRN of the COS bucket.
- Bucket
Location string - The location of the COS bucket.
- Website
Configuration CosBucket Website Configuration Website Configuration Args Nested block have the following structure:
Nested scheme for
website_configuration
:- Cos
Bucket stringWebsite Configuration Id - (String) The ID of the bucket.
- Endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - Timeouts
Cos
Bucket Website Configuration Timeouts Args
- bucket
Crn String - The CRN of the COS bucket.
- bucket
Location String - The location of the COS bucket.
- website
Configuration CosBucket Website Configuration Website Configuration Nested block have the following structure:
Nested scheme for
website_configuration
:- cos
Bucket StringWebsite Configuration Id - (String) The ID of the bucket.
- endpoint
Type String - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Website Configuration Timeouts
- bucket
Crn string - The CRN of the COS bucket.
- bucket
Location string - The location of the COS bucket.
- website
Configuration CosBucket Website Configuration Website Configuration Nested block have the following structure:
Nested scheme for
website_configuration
:- cos
Bucket stringWebsite Configuration Id - (String) The ID of the bucket.
- endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Website Configuration Timeouts
- bucket_
crn str - The CRN of the COS bucket.
- bucket_
location str - The location of the COS bucket.
- website_
configuration CosBucket Website Configuration Website Configuration Args Nested block have the following structure:
Nested scheme for
website_configuration
:- cos_
bucket_ strwebsite_ configuration_ id - (String) The ID of the bucket.
- endpoint_
type str - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Website Configuration Timeouts Args
- bucket
Crn String - The CRN of the COS bucket.
- bucket
Location String - The location of the COS bucket.
- website
Configuration Property Map Nested block have the following structure:
Nested scheme for
website_configuration
:- cos
Bucket StringWebsite Configuration Id - (String) The ID of the bucket.
- endpoint
Type String - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the CosBucketWebsiteConfiguration resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Website
Endpoint string - (String) Endpoint of the website.
- Id string
- The provider-assigned unique ID for this managed resource.
- Website
Endpoint string - (String) Endpoint of the website.
- id String
- The provider-assigned unique ID for this managed resource.
- website
Endpoint String - (String) Endpoint of the website.
- id string
- The provider-assigned unique ID for this managed resource.
- website
Endpoint string - (String) Endpoint of the website.
- id str
- The provider-assigned unique ID for this managed resource.
- website_
endpoint str - (String) Endpoint of the website.
- id String
- The provider-assigned unique ID for this managed resource.
- website
Endpoint String - (String) Endpoint of the website.
Look up Existing CosBucketWebsiteConfiguration Resource
Get an existing CosBucketWebsiteConfiguration 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?: CosBucketWebsiteConfigurationState, opts?: CustomResourceOptions): CosBucketWebsiteConfiguration
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket_crn: Optional[str] = None,
bucket_location: Optional[str] = None,
cos_bucket_website_configuration_id: Optional[str] = None,
endpoint_type: Optional[str] = None,
timeouts: Optional[CosBucketWebsiteConfigurationTimeoutsArgs] = None,
website_configuration: Optional[CosBucketWebsiteConfigurationWebsiteConfigurationArgs] = None,
website_endpoint: Optional[str] = None) -> CosBucketWebsiteConfiguration
func GetCosBucketWebsiteConfiguration(ctx *Context, name string, id IDInput, state *CosBucketWebsiteConfigurationState, opts ...ResourceOption) (*CosBucketWebsiteConfiguration, error)
public static CosBucketWebsiteConfiguration Get(string name, Input<string> id, CosBucketWebsiteConfigurationState? state, CustomResourceOptions? opts = null)
public static CosBucketWebsiteConfiguration get(String name, Output<String> id, CosBucketWebsiteConfigurationState state, CustomResourceOptions options)
resources: _: type: ibm:CosBucketWebsiteConfiguration get: id: ${id}
- 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.
- Bucket
Crn string - The CRN of the COS bucket.
- Bucket
Location string - The location of the COS bucket.
- Cos
Bucket stringWebsite Configuration Id - (String) The ID of the bucket.
- Endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - Timeouts
Cos
Bucket Website Configuration Timeouts - Website
Configuration CosBucket Website Configuration Website Configuration Nested block have the following structure:
Nested scheme for
website_configuration
:- Website
Endpoint string - (String) Endpoint of the website.
- Bucket
Crn string - The CRN of the COS bucket.
- Bucket
Location string - The location of the COS bucket.
- Cos
Bucket stringWebsite Configuration Id - (String) The ID of the bucket.
- Endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - Timeouts
Cos
Bucket Website Configuration Timeouts Args - Website
Configuration CosBucket Website Configuration Website Configuration Args Nested block have the following structure:
Nested scheme for
website_configuration
:- Website
Endpoint string - (String) Endpoint of the website.
- bucket
Crn String - The CRN of the COS bucket.
- bucket
Location String - The location of the COS bucket.
- cos
Bucket StringWebsite Configuration Id - (String) The ID of the bucket.
- endpoint
Type String - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Website Configuration Timeouts - website
Configuration CosBucket Website Configuration Website Configuration Nested block have the following structure:
Nested scheme for
website_configuration
:- website
Endpoint String - (String) Endpoint of the website.
- bucket
Crn string - The CRN of the COS bucket.
- bucket
Location string - The location of the COS bucket.
- cos
Bucket stringWebsite Configuration Id - (String) The ID of the bucket.
- endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Website Configuration Timeouts - website
Configuration CosBucket Website Configuration Website Configuration Nested block have the following structure:
Nested scheme for
website_configuration
:- website
Endpoint string - (String) Endpoint of the website.
- bucket_
crn str - The CRN of the COS bucket.
- bucket_
location str - The location of the COS bucket.
- cos_
bucket_ strwebsite_ configuration_ id - (String) The ID of the bucket.
- endpoint_
type str - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Website Configuration Timeouts Args - website_
configuration CosBucket Website Configuration Website Configuration Args Nested block have the following structure:
Nested scheme for
website_configuration
:- website_
endpoint str - (String) Endpoint of the website.
- bucket
Crn String - The CRN of the COS bucket.
- bucket
Location String - The location of the COS bucket.
- cos
Bucket StringWebsite Configuration Id - (String) The ID of the bucket.
- endpoint
Type String - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts Property Map
- website
Configuration Property Map Nested block have the following structure:
Nested scheme for
website_configuration
:- website
Endpoint String - (String) Endpoint of the website.
Supporting Types
CosBucketWebsiteConfigurationTimeouts, CosBucketWebsiteConfigurationTimeoutsArgs
CosBucketWebsiteConfigurationWebsiteConfiguration, CosBucketWebsiteConfigurationWebsiteConfigurationArgs
- Error
Document CosBucket Website Configuration Website Configuration Error Document When a static website bucket error occurs, an HTML page of the error provided by the configured
error_document
will be returned.Nested scheme for
error_document
:- Index
Document CosBucket Website Configuration Website Configuration Index Document This is the home or default page of the website.
Nested scheme for
index_document
:- Redirect
All CosRequests To Bucket Website Configuration Website Configuration Redirect All Requests To - Redirect requests can be set to specific page documents, individual routing rules, or redirect all requests globally to one bucket or domain.
- Routing
Rule List<CosBucket Website Configuration Website Configuration Routing Rule> List of rules that define when a redirect is applied and the redirect behavior.
Nested scheme for
routing_rule
:- Routing
Rules string JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.
Note: There is a limitation of 50 routing rules per website configuration.
- Error
Document CosBucket Website Configuration Website Configuration Error Document When a static website bucket error occurs, an HTML page of the error provided by the configured
error_document
will be returned.Nested scheme for
error_document
:- Index
Document CosBucket Website Configuration Website Configuration Index Document This is the home or default page of the website.
Nested scheme for
index_document
:- Redirect
All CosRequests To Bucket Website Configuration Website Configuration Redirect All Requests To - Redirect requests can be set to specific page documents, individual routing rules, or redirect all requests globally to one bucket or domain.
- Routing
Rule []CosBucket Website Configuration Website Configuration Routing Rule List of rules that define when a redirect is applied and the redirect behavior.
Nested scheme for
routing_rule
:- Routing
Rules string JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.
Note: There is a limitation of 50 routing rules per website configuration.
- error
Document CosBucket Website Configuration Website Configuration Error Document When a static website bucket error occurs, an HTML page of the error provided by the configured
error_document
will be returned.Nested scheme for
error_document
:- index
Document CosBucket Website Configuration Website Configuration Index Document This is the home or default page of the website.
Nested scheme for
index_document
:- redirect
All CosRequests To Bucket Website Configuration Website Configuration Redirect All Requests To - Redirect requests can be set to specific page documents, individual routing rules, or redirect all requests globally to one bucket or domain.
- routing
Rule List<CosBucket Website Configuration Website Configuration Routing Rule> List of rules that define when a redirect is applied and the redirect behavior.
Nested scheme for
routing_rule
:- routing
Rules String JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.
Note: There is a limitation of 50 routing rules per website configuration.
- error
Document CosBucket Website Configuration Website Configuration Error Document When a static website bucket error occurs, an HTML page of the error provided by the configured
error_document
will be returned.Nested scheme for
error_document
:- index
Document CosBucket Website Configuration Website Configuration Index Document This is the home or default page of the website.
Nested scheme for
index_document
:- redirect
All CosRequests To Bucket Website Configuration Website Configuration Redirect All Requests To - Redirect requests can be set to specific page documents, individual routing rules, or redirect all requests globally to one bucket or domain.
- routing
Rule CosBucket Website Configuration Website Configuration Routing Rule[] List of rules that define when a redirect is applied and the redirect behavior.
Nested scheme for
routing_rule
:- routing
Rules string JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.
Note: There is a limitation of 50 routing rules per website configuration.
- error_
document CosBucket Website Configuration Website Configuration Error Document When a static website bucket error occurs, an HTML page of the error provided by the configured
error_document
will be returned.Nested scheme for
error_document
:- index_
document CosBucket Website Configuration Website Configuration Index Document This is the home or default page of the website.
Nested scheme for
index_document
:- redirect_
all_ Cosrequests_ to Bucket Website Configuration Website Configuration Redirect All Requests To - Redirect requests can be set to specific page documents, individual routing rules, or redirect all requests globally to one bucket or domain.
- routing_
rule Sequence[CosBucket Website Configuration Website Configuration Routing Rule] List of rules that define when a redirect is applied and the redirect behavior.
Nested scheme for
routing_rule
:- routing_
rules str JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.
Note: There is a limitation of 50 routing rules per website configuration.
- error
Document Property Map When a static website bucket error occurs, an HTML page of the error provided by the configured
error_document
will be returned.Nested scheme for
error_document
:- index
Document Property Map This is the home or default page of the website.
Nested scheme for
index_document
:- redirect
All Property MapRequests To - Redirect requests can be set to specific page documents, individual routing rules, or redirect all requests globally to one bucket or domain.
- routing
Rule List<Property Map> List of rules that define when a redirect is applied and the redirect behavior.
Nested scheme for
routing_rule
:- routing
Rules String JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.
Note: There is a limitation of 50 routing rules per website configuration.
CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocument, CosBucketWebsiteConfigurationWebsiteConfigurationErrorDocumentArgs
- Key string
- Object key name to use when a 4XX class error occurs.
- Key string
- Object key name to use when a 4XX class error occurs.
- key String
- Object key name to use when a 4XX class error occurs.
- key string
- Object key name to use when a 4XX class error occurs.
- key str
- Object key name to use when a 4XX class error occurs.
- key String
- Object key name to use when a 4XX class error occurs.
CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocument, CosBucketWebsiteConfigurationWebsiteConfigurationIndexDocumentArgs
- Suffix string
- This suffix is the document that will be returned for requests made to the root of the website .For example, if the suffix is
index.html
and you make a request tomywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud
, the data that is returned will be formywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud/index.html
. Note: The suffix must not be empty and must not include a slash character.
- Suffix string
- This suffix is the document that will be returned for requests made to the root of the website .For example, if the suffix is
index.html
and you make a request tomywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud
, the data that is returned will be formywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud/index.html
. Note: The suffix must not be empty and must not include a slash character.
- suffix String
- This suffix is the document that will be returned for requests made to the root of the website .For example, if the suffix is
index.html
and you make a request tomywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud
, the data that is returned will be formywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud/index.html
. Note: The suffix must not be empty and must not include a slash character.
- suffix string
- This suffix is the document that will be returned for requests made to the root of the website .For example, if the suffix is
index.html
and you make a request tomywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud
, the data that is returned will be formywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud/index.html
. Note: The suffix must not be empty and must not include a slash character.
- suffix str
- This suffix is the document that will be returned for requests made to the root of the website .For example, if the suffix is
index.html
and you make a request tomywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud
, the data that is returned will be formywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud/index.html
. Note: The suffix must not be empty and must not include a slash character.
- suffix String
- This suffix is the document that will be returned for requests made to the root of the website .For example, if the suffix is
index.html
and you make a request tomywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud
, the data that is returned will be formywebsitedomain.s3-web.us-east.cloud-object-storage.appdomain.cloud/index.html
. Note: The suffix must not be empty and must not include a slash character.
CosBucketWebsiteConfigurationWebsiteConfigurationRedirectAllRequestsTo, CosBucketWebsiteConfigurationWebsiteConfigurationRedirectAllRequestsToArgs
CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRule, CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleArgs
- Redirect
Cos
Bucket Website Configuration Website Configuration Routing Rule Redirect - Configuration block for redirect behaviour.
Nested scheme for
redirect
: - Condition
Cos
Bucket Website Configuration Website Configuration Routing Rule Condition Configuration block for a condition to be satisfied for the redirect behaviour to be applied.
Nested scheme for
condition
:
- Redirect
Cos
Bucket Website Configuration Website Configuration Routing Rule Redirect - Configuration block for redirect behaviour.
Nested scheme for
redirect
: - Condition
Cos
Bucket Website Configuration Website Configuration Routing Rule Condition Configuration block for a condition to be satisfied for the redirect behaviour to be applied.
Nested scheme for
condition
:
- redirect
Cos
Bucket Website Configuration Website Configuration Routing Rule Redirect - Configuration block for redirect behaviour.
Nested scheme for
redirect
: - condition
Cos
Bucket Website Configuration Website Configuration Routing Rule Condition Configuration block for a condition to be satisfied for the redirect behaviour to be applied.
Nested scheme for
condition
:
- redirect
Cos
Bucket Website Configuration Website Configuration Routing Rule Redirect - Configuration block for redirect behaviour.
Nested scheme for
redirect
: - condition
Cos
Bucket Website Configuration Website Configuration Routing Rule Condition Configuration block for a condition to be satisfied for the redirect behaviour to be applied.
Nested scheme for
condition
:
- redirect
Cos
Bucket Website Configuration Website Configuration Routing Rule Redirect - Configuration block for redirect behaviour.
Nested scheme for
redirect
: - condition
Cos
Bucket Website Configuration Website Configuration Routing Rule Condition Configuration block for a condition to be satisfied for the redirect behaviour to be applied.
Nested scheme for
condition
:
- redirect Property Map
- Configuration block for redirect behaviour.
Nested scheme for
redirect
: - condition Property Map
Configuration block for a condition to be satisfied for the redirect behaviour to be applied.
Nested scheme for
condition
:
CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleCondition, CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleConditionArgs
- Http
Error stringCode Returned Equals - The HTTP error code when the redirect is applied. Valid codes are 4XX or 5XX..
- Key
Prefix stringEquals - The object key name prefix when the redirect is applied..
- Http
Error stringCode Returned Equals - The HTTP error code when the redirect is applied. Valid codes are 4XX or 5XX..
- Key
Prefix stringEquals - The object key name prefix when the redirect is applied..
- http
Error StringCode Returned Equals - The HTTP error code when the redirect is applied. Valid codes are 4XX or 5XX..
- key
Prefix StringEquals - The object key name prefix when the redirect is applied..
- http
Error stringCode Returned Equals - The HTTP error code when the redirect is applied. Valid codes are 4XX or 5XX..
- key
Prefix stringEquals - The object key name prefix when the redirect is applied..
- http_
error_ strcode_ returned_ equals - The HTTP error code when the redirect is applied. Valid codes are 4XX or 5XX..
- key_
prefix_ strequals - The object key name prefix when the redirect is applied..
- http
Error StringCode Returned Equals - The HTTP error code when the redirect is applied. Valid codes are 4XX or 5XX..
- key
Prefix StringEquals - The object key name prefix when the redirect is applied..
CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleRedirect, CosBucketWebsiteConfigurationWebsiteConfigurationRoutingRuleRedirectArgs
- Host
Name string - The host name the request should be redirected to.
- Http
Redirect stringCode - The HTTP redirect code to use on the response. Valid codes are 3XX except 300..
- Protocol string
- Protocol to be used in the Location header that is returned in the response.
- Replace
Key stringPrefix With - The prefix of the object key name that replaces the value of KeyPrefixEquals in the redirect request.
- Replace
Key stringWith - The object key to be used in the Location header that is returned in the response.
- Host
Name string - The host name the request should be redirected to.
- Http
Redirect stringCode - The HTTP redirect code to use on the response. Valid codes are 3XX except 300..
- Protocol string
- Protocol to be used in the Location header that is returned in the response.
- Replace
Key stringPrefix With - The prefix of the object key name that replaces the value of KeyPrefixEquals in the redirect request.
- Replace
Key stringWith - The object key to be used in the Location header that is returned in the response.
- host
Name String - The host name the request should be redirected to.
- http
Redirect StringCode - The HTTP redirect code to use on the response. Valid codes are 3XX except 300..
- protocol String
- Protocol to be used in the Location header that is returned in the response.
- replace
Key StringPrefix With - The prefix of the object key name that replaces the value of KeyPrefixEquals in the redirect request.
- replace
Key StringWith - The object key to be used in the Location header that is returned in the response.
- host
Name string - The host name the request should be redirected to.
- http
Redirect stringCode - The HTTP redirect code to use on the response. Valid codes are 3XX except 300..
- protocol string
- Protocol to be used in the Location header that is returned in the response.
- replace
Key stringPrefix With - The prefix of the object key name that replaces the value of KeyPrefixEquals in the redirect request.
- replace
Key stringWith - The object key to be used in the Location header that is returned in the response.
- host_
name str - The host name the request should be redirected to.
- http_
redirect_ strcode - The HTTP redirect code to use on the response. Valid codes are 3XX except 300..
- protocol str
- Protocol to be used in the Location header that is returned in the response.
- replace_
key_ strprefix_ with - The prefix of the object key name that replaces the value of KeyPrefixEquals in the redirect request.
- replace_
key_ strwith - The object key to be used in the Location header that is returned in the response.
- host
Name String - The host name the request should be redirected to.
- http
Redirect StringCode - The HTTP redirect code to use on the response. Valid codes are 3XX except 300..
- protocol String
- Protocol to be used in the Location header that is returned in the response.
- replace
Key StringPrefix With - The prefix of the object key name that replaces the value of KeyPrefixEquals in the redirect request.
- replace
Key StringWith - The object key to be used in the Location header that is returned in the response.
Import
IBM COS Bucket
The ibm.CosBucketWebsiteConfiguration
resource can be imported by using the id
. The ID is formed from the CRN
(Cloud Resource Name). The CRN
and bucket location can be found on the portal.
id = $CRN:meta:$bucketlocation:$endpointtype
Syntax
$ terraform import ibm_cos_bucket_website_configuration.website `$CRN:meta:$bucketlocation:public`
Example
$ terraform import ibm_cos_bucket_website_configuration.website crn:v1:bluemix:public:cloud-object-storage:global:a/ee858e45752d4696b2d082bcf2357559:84aaaaa4-3a22-477b-8635-75501eac96f7:bucket:bucketname:meta:us-south:public
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.