S3Location class
Manages an S3 Location within AWS DataSync.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.datasync.S3Location("example", {
s3Config: {
bucketAccessRoleArn: exampleAwsIamRole.arn,
},
s3BucketArn: exampleAwsS3Bucket.arn,
subdirectory: "/example/prefix",
});
import pulumi
import pulumi_aws as aws
example = aws.datasync.S3Location("example",
s3_config={
"bucket_access_role_arn": example_aws_iam_role["arn"],
},
s3_bucket_arn=example_aws_s3_bucket["arn"],
subdirectory="/example/prefix")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.DataSync.S3Location("example", new()
{
S3Config = new Aws.DataSync.Inputs.S3LocationS3ConfigArgs
{
BucketAccessRoleArn = exampleAwsIamRole.Arn,
},
S3BucketArn = exampleAwsS3Bucket.Arn,
Subdirectory = "/example/prefix",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/datasync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datasync.NewS3Location(ctx, "example", &datasync.S3LocationArgs{
S3Config: &datasync.S3LocationS3ConfigArgs{
BucketAccessRoleArn: pulumi.Any(exampleAwsIamRole.Arn),
},
S3BucketArn: pulumi.Any(exampleAwsS3Bucket.Arn),
Subdirectory: pulumi.String("/example/prefix"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_datasync_s3location" "example" {
s3_config = {
bucket_access_role_arn = exampleAwsIamRole.arn
}
s3_bucket_arn = exampleAwsS3Bucket.arn
subdirectory = "/example/prefix"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.datasync.S3Location;
import com.pulumi.aws.datasync.S3LocationArgs;
import com.pulumi.aws.datasync.inputs.S3LocationS3ConfigArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 S3Location("example", S3LocationArgs.builder()
.s3Config(S3LocationS3ConfigArgs.builder()
.bucketAccessRoleArn(exampleAwsIamRole.arn())
.build())
.s3BucketArn(exampleAwsS3Bucket.arn())
.subdirectory("/example/prefix")
.build());
}
}
resources:
example:
type: aws:datasync:S3Location
properties:
s3Config:
bucketAccessRoleArn: ${exampleAwsIamRole.arn}
s3BucketArn: ${exampleAwsS3Bucket.arn}
subdirectory: /example/prefix
S3 Bucket on AWS Outposts
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const destination = new aws.datasync.S3Location("destination", {
s3Config: {
bucketAccessRoleArn: example.arn,
},
agentArns: [exampleAwsDatasyncAgent.arn],
s3BucketArn: exampleAwsS3AccessPoint.arn,
s3StorageClass: "OUTPOSTS",
subdirectory: "/example/prefix",
});
import pulumi
import pulumi_aws as aws
destination = aws.datasync.S3Location("destination",
s3_config={
"bucket_access_role_arn": example["arn"],
},
agent_arns=[example_aws_datasync_agent["arn"]],
s3_bucket_arn=example_aws_s3_access_point["arn"],
s3_storage_class="OUTPOSTS",
subdirectory="/example/prefix")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var destination = new Aws.DataSync.S3Location("destination", new()
{
S3Config = new Aws.DataSync.Inputs.S3LocationS3ConfigArgs
{
BucketAccessRoleArn = example.Arn,
},
AgentArns = new[]
{
exampleAwsDatasyncAgent.Arn,
},
S3BucketArn = exampleAwsS3AccessPoint.Arn,
S3StorageClass = "OUTPOSTS",
Subdirectory = "/example/prefix",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/datasync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datasync.NewS3Location(ctx, "destination", &datasync.S3LocationArgs{
S3Config: &datasync.S3LocationS3ConfigArgs{
BucketAccessRoleArn: pulumi.Any(example.Arn),
},
AgentArns: pulumi.StringArray{
exampleAwsDatasyncAgent.Arn,
},
S3BucketArn: pulumi.Any(exampleAwsS3AccessPoint.Arn),
S3StorageClass: pulumi.String("OUTPOSTS"),
Subdirectory: pulumi.String("/example/prefix"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_datasync_s3location" "destination" {
s3_config = {
bucket_access_role_arn = example.arn
}
agent_arns = [exampleAwsDatasyncAgent.arn]
s3_bucket_arn = exampleAwsS3AccessPoint.arn
s3_storage_class = "OUTPOSTS"
subdirectory = "/example/prefix"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.datasync.S3Location;
import com.pulumi.aws.datasync.S3LocationArgs;
import com.pulumi.aws.datasync.inputs.S3LocationS3ConfigArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 destination = new S3Location("destination", S3LocationArgs.builder()
.s3Config(S3LocationS3ConfigArgs.builder()
.bucketAccessRoleArn(example.arn())
.build())
.agentArns(exampleAwsDatasyncAgent.arn())
.s3BucketArn(exampleAwsS3AccessPoint.arn())
.s3StorageClass("OUTPOSTS")
.subdirectory("/example/prefix")
.build());
}
}
resources:
destination:
type: aws:datasync:S3Location
properties:
s3Config:
bucketAccessRoleArn: ${example.arn}
agentArns:
- ${exampleAwsDatasyncAgent.arn}
s3BucketArn: ${exampleAwsS3AccessPoint.arn}
s3StorageClass: OUTPOSTS
subdirectory: /example/prefix
Import
Identity Schema
Required
arn(String) ARN of the DataSync S3 location.
Using pulumi import, import aws.datasync.S3Location using the DataSync Task ARN. For example:
$ pulumi import aws:datasync/s3Location:S3Location example arn:aws:datasync:us-east-1:123456789012:location/loc-12345678901234567
Constructors
- S3Location(String name, {S3LocationArgs? args, CustomResourceOptions? options})
-
Creates a new S3Location.
nameThe Pulumi resource name.argsArguments used to configure this S3Location. The set of arguments for S3Location.optionsResource options controlling this resource's behavior. - S3Location.reference(String urn)
- Creates a typed reference to an existing S3Location resource.
Properties
-
agentArns
↔ Output<
List< String> ?> -
(Amazon S3 on Outposts only) ARN of the DataSync agent on the Outpost.
latefinal
-
arn
↔ Output<
String> -
ARN of the DataSync Location.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
s3BucketArn
↔ Output<
String> -
ARN of the S3 bucket, or the Amazon S3 access point if the S3 bucket is located on an AWS Outposts resource.
latefinal
-
s3Config
↔ Output<
S3LocationS3Config> -
Configuration block containing information for connecting to S3.
latefinal
-
s3StorageClass
↔ Output<
String> -
Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values
latefinal
-
subdirectory
↔ Output<
String> -
Prefix to perform actions as source or destination.
latefinal
-
Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
A map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
uri
↔ Output<
String> -
latefinal
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {S3LocationState? state, CustomResourceOptions? options}) → S3Location -
Gets an existing S3Location resource's state with the given
nameandid.