digitalocean.SpacesBucketLogging
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const assets = new digitalocean.SpacesBucket("assets", {
name: "assets",
region: digitalocean.Region.NYC3,
});
const logs = new digitalocean.SpacesBucket("logs", {
name: "logs",
region: digitalocean.Region.NYC3,
});
const example = new digitalocean.SpacesBucketLogging("example", {
region: "%s",
bucket: assets.id,
targetBucket: logs.id,
targetPrefix: "access-logs/",
});
import pulumi
import pulumi_digitalocean as digitalocean
assets = digitalocean.SpacesBucket("assets",
name="assets",
region=digitalocean.Region.NYC3)
logs = digitalocean.SpacesBucket("logs",
name="logs",
region=digitalocean.Region.NYC3)
example = digitalocean.SpacesBucketLogging("example",
region="%s",
bucket=assets.id,
target_bucket=logs.id,
target_prefix="access-logs/")
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
assets, err := digitalocean.NewSpacesBucket(ctx, "assets", &digitalocean.SpacesBucketArgs{
Name: pulumi.String("assets"),
Region: pulumi.String(digitalocean.RegionNYC3),
})
if err != nil {
return err
}
logs, err := digitalocean.NewSpacesBucket(ctx, "logs", &digitalocean.SpacesBucketArgs{
Name: pulumi.String("logs"),
Region: pulumi.String(digitalocean.RegionNYC3),
})
if err != nil {
return err
}
_, err = digitalocean.NewSpacesBucketLogging(ctx, "example", &digitalocean.SpacesBucketLoggingArgs{
Region: pulumi.String("%s"),
Bucket: assets.ID(),
TargetBucket: logs.ID(),
TargetPrefix: pulumi.String("access-logs/"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var assets = new DigitalOcean.SpacesBucket("assets", new()
{
Name = "assets",
Region = DigitalOcean.Region.NYC3,
});
var logs = new DigitalOcean.SpacesBucket("logs", new()
{
Name = "logs",
Region = DigitalOcean.Region.NYC3,
});
var example = new DigitalOcean.SpacesBucketLogging("example", new()
{
Region = "%s",
Bucket = assets.Id,
TargetBucket = logs.Id,
TargetPrefix = "access-logs/",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.SpacesBucket;
import com.pulumi.digitalocean.SpacesBucketArgs;
import com.pulumi.digitalocean.SpacesBucketLogging;
import com.pulumi.digitalocean.SpacesBucketLoggingArgs;
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 assets = new SpacesBucket("assets", SpacesBucketArgs.builder()
.name("assets")
.region("nyc3")
.build());
var logs = new SpacesBucket("logs", SpacesBucketArgs.builder()
.name("logs")
.region("nyc3")
.build());
var example = new SpacesBucketLogging("example", SpacesBucketLoggingArgs.builder()
.region("%s")
.bucket(assets.id())
.targetBucket(logs.id())
.targetPrefix("access-logs/")
.build());
}
}
resources:
assets:
type: digitalocean:SpacesBucket
properties:
name: assets
region: nyc3
logs:
type: digitalocean:SpacesBucket
properties:
name: logs
region: nyc3
example:
type: digitalocean:SpacesBucketLogging
properties:
region: '%s'
bucket: ${assets.id}
targetBucket: ${logs.id}
targetPrefix: access-logs/
Create SpacesBucketLogging Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SpacesBucketLogging(name: string, args: SpacesBucketLoggingArgs, opts?: CustomResourceOptions);
@overload
def SpacesBucketLogging(resource_name: str,
args: SpacesBucketLoggingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SpacesBucketLogging(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
region: Optional[str] = None,
target_bucket: Optional[str] = None,
target_prefix: Optional[str] = None)
func NewSpacesBucketLogging(ctx *Context, name string, args SpacesBucketLoggingArgs, opts ...ResourceOption) (*SpacesBucketLogging, error)
public SpacesBucketLogging(string name, SpacesBucketLoggingArgs args, CustomResourceOptions? opts = null)
public SpacesBucketLogging(String name, SpacesBucketLoggingArgs args)
public SpacesBucketLogging(String name, SpacesBucketLoggingArgs args, CustomResourceOptions options)
type: digitalocean:SpacesBucketLogging
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 SpacesBucketLoggingArgs
- 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 SpacesBucketLoggingArgs
- 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 SpacesBucketLoggingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SpacesBucketLoggingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SpacesBucketLoggingArgs
- 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 spacesBucketLoggingResource = new DigitalOcean.SpacesBucketLogging("spacesBucketLoggingResource", new()
{
Bucket = "string",
Region = "string",
TargetBucket = "string",
TargetPrefix = "string",
});
example, err := digitalocean.NewSpacesBucketLogging(ctx, "spacesBucketLoggingResource", &digitalocean.SpacesBucketLoggingArgs{
Bucket: pulumi.String("string"),
Region: pulumi.String("string"),
TargetBucket: pulumi.String("string"),
TargetPrefix: pulumi.String("string"),
})
var spacesBucketLoggingResource = new SpacesBucketLogging("spacesBucketLoggingResource", SpacesBucketLoggingArgs.builder()
.bucket("string")
.region("string")
.targetBucket("string")
.targetPrefix("string")
.build());
spaces_bucket_logging_resource = digitalocean.SpacesBucketLogging("spacesBucketLoggingResource",
bucket="string",
region="string",
target_bucket="string",
target_prefix="string")
const spacesBucketLoggingResource = new digitalocean.SpacesBucketLogging("spacesBucketLoggingResource", {
bucket: "string",
region: "string",
targetBucket: "string",
targetPrefix: "string",
});
type: digitalocean:SpacesBucketLogging
properties:
bucket: string
region: string
targetBucket: string
targetPrefix: string
SpacesBucketLogging 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 SpacesBucketLogging resource accepts the following input properties:
- Bucket string
- The name of the bucket which will be logged.
- Region string
- The region where the bucket resides.
- Target
Bucket string - The name of the bucket which will store the logs.
- Target
Prefix string - The prefix for the log files.
- Bucket string
- The name of the bucket which will be logged.
- Region string
- The region where the bucket resides.
- Target
Bucket string - The name of the bucket which will store the logs.
- Target
Prefix string - The prefix for the log files.
- bucket String
- The name of the bucket which will be logged.
- region String
- The region where the bucket resides.
- target
Bucket String - The name of the bucket which will store the logs.
- target
Prefix String - The prefix for the log files.
- bucket string
- The name of the bucket which will be logged.
- region string
- The region where the bucket resides.
- target
Bucket string - The name of the bucket which will store the logs.
- target
Prefix string - The prefix for the log files.
- bucket str
- The name of the bucket which will be logged.
- region str
- The region where the bucket resides.
- target_
bucket str - The name of the bucket which will store the logs.
- target_
prefix str - The prefix for the log files.
- bucket String
- The name of the bucket which will be logged.
- region String
- The region where the bucket resides.
- target
Bucket String - The name of the bucket which will store the logs.
- target
Prefix String - The prefix for the log files.
Outputs
All input properties are implicitly available as output properties. Additionally, the SpacesBucketLogging 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 SpacesBucketLogging Resource
Get an existing SpacesBucketLogging 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?: SpacesBucketLoggingState, opts?: CustomResourceOptions): SpacesBucketLogging
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
region: Optional[str] = None,
target_bucket: Optional[str] = None,
target_prefix: Optional[str] = None) -> SpacesBucketLogging
func GetSpacesBucketLogging(ctx *Context, name string, id IDInput, state *SpacesBucketLoggingState, opts ...ResourceOption) (*SpacesBucketLogging, error)
public static SpacesBucketLogging Get(string name, Input<string> id, SpacesBucketLoggingState? state, CustomResourceOptions? opts = null)
public static SpacesBucketLogging get(String name, Output<String> id, SpacesBucketLoggingState state, CustomResourceOptions options)
resources: _: type: digitalocean:SpacesBucketLogging 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 string
- The name of the bucket which will be logged.
- Region string
- The region where the bucket resides.
- Target
Bucket string - The name of the bucket which will store the logs.
- Target
Prefix string - The prefix for the log files.
- Bucket string
- The name of the bucket which will be logged.
- Region string
- The region where the bucket resides.
- Target
Bucket string - The name of the bucket which will store the logs.
- Target
Prefix string - The prefix for the log files.
- bucket String
- The name of the bucket which will be logged.
- region String
- The region where the bucket resides.
- target
Bucket String - The name of the bucket which will store the logs.
- target
Prefix String - The prefix for the log files.
- bucket string
- The name of the bucket which will be logged.
- region string
- The region where the bucket resides.
- target
Bucket string - The name of the bucket which will store the logs.
- target
Prefix string - The prefix for the log files.
- bucket str
- The name of the bucket which will be logged.
- region str
- The region where the bucket resides.
- target_
bucket str - The name of the bucket which will store the logs.
- target_
prefix str - The prefix for the log files.
- bucket String
- The name of the bucket which will be logged.
- region String
- The region where the bucket resides.
- target
Bucket String - The name of the bucket which will store the logs.
- target
Prefix String - The prefix for the log files.
Import
Spaces bucket logging can be imported using the region
and bucket
attributes (delimited by a comma):
$ pulumi import digitalocean:index/spacesBucketLogging:SpacesBucketLogging example `region`,`bucket`
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.