aws logo
AWS Classic v5.28.0, Jan 23 23

aws.ssm.ResourceDataSync

Provides a SSM resource data sync.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var hogeBucketV2 = new Aws.S3.BucketV2("hogeBucketV2");

    var hogeBucketPolicy = new Aws.S3.BucketPolicy("hogeBucketPolicy", new()
    {
        Bucket = hogeBucketV2.Bucket,
        Policy = @"{
    ""Version"": ""2012-10-17"",
    ""Statement"": [
        {
            ""Sid"": ""SSMBucketPermissionsCheck"",
            ""Effect"": ""Allow"",
            ""Principal"": {
                ""Service"": ""ssm.amazonaws.com""
            },
            ""Action"": ""s3:GetBucketAcl"",
            ""Resource"": ""arn:aws:s3:::tf-test-bucket-1234""
        },
        {
            ""Sid"": "" SSMBucketDelivery"",
            ""Effect"": ""Allow"",
            ""Principal"": {
                ""Service"": ""ssm.amazonaws.com""
            },
            ""Action"": ""s3:PutObject"",
            ""Resource"": [""arn:aws:s3:::tf-test-bucket-1234/*""],
            ""Condition"": {
                ""StringEquals"": {
                    ""s3:x-amz-acl"": ""bucket-owner-full-control""
                }
            }
        }
    ]
}
",
    });

    var foo = new Aws.Ssm.ResourceDataSync("foo", new()
    {
        S3Destination = new Aws.Ssm.Inputs.ResourceDataSyncS3DestinationArgs
        {
            BucketName = hogeBucketV2.Bucket,
            Region = hogeBucketV2.Region,
        },
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/s3"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ssm"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		hogeBucketV2, err := s3.NewBucketV2(ctx, "hogeBucketV2", nil)
		if err != nil {
			return err
		}
		_, err = s3.NewBucketPolicy(ctx, "hogeBucketPolicy", &s3.BucketPolicyArgs{
			Bucket: hogeBucketV2.Bucket,
			Policy: pulumi.Any(fmt.Sprintf(`{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "SSMBucketPermissionsCheck",
            "Effect": "Allow",
            "Principal": {
                "Service": "ssm.amazonaws.com"
            },
            "Action": "s3:GetBucketAcl",
            "Resource": "arn:aws:s3:::tf-test-bucket-1234"
        },
        {
            "Sid": " SSMBucketDelivery",
            "Effect": "Allow",
            "Principal": {
                "Service": "ssm.amazonaws.com"
            },
            "Action": "s3:PutObject",
            "Resource": ["arn:aws:s3:::tf-test-bucket-1234/*"],
            "Condition": {
                "StringEquals": {
                    "s3:x-amz-acl": "bucket-owner-full-control"
                }
            }
        }
    ]
}
`)),
		})
		if err != nil {
			return err
		}
		_, err = ssm.NewResourceDataSync(ctx, "foo", &ssm.ResourceDataSyncArgs{
			S3Destination: &ssm.ResourceDataSyncS3DestinationArgs{
				BucketName: hogeBucketV2.Bucket,
				Region:     hogeBucketV2.Region,
			},
		})
		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.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketPolicy;
import com.pulumi.aws.s3.BucketPolicyArgs;
import com.pulumi.aws.ssm.ResourceDataSync;
import com.pulumi.aws.ssm.ResourceDataSyncArgs;
import com.pulumi.aws.ssm.inputs.ResourceDataSyncS3DestinationArgs;
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 hogeBucketV2 = new BucketV2("hogeBucketV2");

        var hogeBucketPolicy = new BucketPolicy("hogeBucketPolicy", BucketPolicyArgs.builder()        
            .bucket(hogeBucketV2.bucket())
            .policy("""
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "SSMBucketPermissionsCheck",
            "Effect": "Allow",
            "Principal": {
                "Service": "ssm.amazonaws.com"
            },
            "Action": "s3:GetBucketAcl",
            "Resource": "arn:aws:s3:::tf-test-bucket-1234"
        },
        {
            "Sid": " SSMBucketDelivery",
            "Effect": "Allow",
            "Principal": {
                "Service": "ssm.amazonaws.com"
            },
            "Action": "s3:PutObject",
            "Resource": ["arn:aws:s3:::tf-test-bucket-1234/*"],
            "Condition": {
                "StringEquals": {
                    "s3:x-amz-acl": "bucket-owner-full-control"
                }
            }
        }
    ]
}
            """)
            .build());

        var foo = new ResourceDataSync("foo", ResourceDataSyncArgs.builder()        
            .s3Destination(ResourceDataSyncS3DestinationArgs.builder()
                .bucketName(hogeBucketV2.bucket())
                .region(hogeBucketV2.region())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

hoge_bucket_v2 = aws.s3.BucketV2("hogeBucketV2")
hoge_bucket_policy = aws.s3.BucketPolicy("hogeBucketPolicy",
    bucket=hoge_bucket_v2.bucket,
    policy="""{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "SSMBucketPermissionsCheck",
            "Effect": "Allow",
            "Principal": {
                "Service": "ssm.amazonaws.com"
            },
            "Action": "s3:GetBucketAcl",
            "Resource": "arn:aws:s3:::tf-test-bucket-1234"
        },
        {
            "Sid": " SSMBucketDelivery",
            "Effect": "Allow",
            "Principal": {
                "Service": "ssm.amazonaws.com"
            },
            "Action": "s3:PutObject",
            "Resource": ["arn:aws:s3:::tf-test-bucket-1234/*"],
            "Condition": {
                "StringEquals": {
                    "s3:x-amz-acl": "bucket-owner-full-control"
                }
            }
        }
    ]
}
""")
foo = aws.ssm.ResourceDataSync("foo", s3_destination=aws.ssm.ResourceDataSyncS3DestinationArgs(
    bucket_name=hoge_bucket_v2.bucket,
    region=hoge_bucket_v2.region,
))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const hogeBucketV2 = new aws.s3.BucketV2("hogeBucketV2", {});
const hogeBucketPolicy = new aws.s3.BucketPolicy("hogeBucketPolicy", {
    bucket: hogeBucketV2.bucket,
    policy: `{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "SSMBucketPermissionsCheck",
            "Effect": "Allow",
            "Principal": {
                "Service": "ssm.amazonaws.com"
            },
            "Action": "s3:GetBucketAcl",
            "Resource": "arn:aws:s3:::tf-test-bucket-1234"
        },
        {
            "Sid": " SSMBucketDelivery",
            "Effect": "Allow",
            "Principal": {
                "Service": "ssm.amazonaws.com"
            },
            "Action": "s3:PutObject",
            "Resource": ["arn:aws:s3:::tf-test-bucket-1234/*"],
            "Condition": {
                "StringEquals": {
                    "s3:x-amz-acl": "bucket-owner-full-control"
                }
            }
        }
    ]
}
`,
});
const foo = new aws.ssm.ResourceDataSync("foo", {s3Destination: {
    bucketName: hogeBucketV2.bucket,
    region: hogeBucketV2.region,
}});
resources:
  hogeBucketV2:
    type: aws:s3:BucketV2
  hogeBucketPolicy:
    type: aws:s3:BucketPolicy
    properties:
      bucket: ${hogeBucketV2.bucket}
      policy: |
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Sid": "SSMBucketPermissionsCheck",
                    "Effect": "Allow",
                    "Principal": {
                        "Service": "ssm.amazonaws.com"
                    },
                    "Action": "s3:GetBucketAcl",
                    "Resource": "arn:aws:s3:::tf-test-bucket-1234"
                },
                {
                    "Sid": " SSMBucketDelivery",
                    "Effect": "Allow",
                    "Principal": {
                        "Service": "ssm.amazonaws.com"
                    },
                    "Action": "s3:PutObject",
                    "Resource": ["arn:aws:s3:::tf-test-bucket-1234/*"],
                    "Condition": {
                        "StringEquals": {
                            "s3:x-amz-acl": "bucket-owner-full-control"
                        }
                    }
                }
            ]
        }        
  foo:
    type: aws:ssm:ResourceDataSync
    properties:
      s3Destination:
        bucketName: ${hogeBucketV2.bucket}
        region: ${hogeBucketV2.region}

Create ResourceDataSync Resource

new ResourceDataSync(name: string, args: ResourceDataSyncArgs, opts?: CustomResourceOptions);
@overload
def ResourceDataSync(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     name: Optional[str] = None,
                     s3_destination: Optional[ResourceDataSyncS3DestinationArgs] = None)
@overload
def ResourceDataSync(resource_name: str,
                     args: ResourceDataSyncArgs,
                     opts: Optional[ResourceOptions] = None)
func NewResourceDataSync(ctx *Context, name string, args ResourceDataSyncArgs, opts ...ResourceOption) (*ResourceDataSync, error)
public ResourceDataSync(string name, ResourceDataSyncArgs args, CustomResourceOptions? opts = null)
public ResourceDataSync(String name, ResourceDataSyncArgs args)
public ResourceDataSync(String name, ResourceDataSyncArgs args, CustomResourceOptions options)
type: aws:ssm:ResourceDataSync
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ResourceDataSyncArgs
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 ResourceDataSyncArgs
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 ResourceDataSyncArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ResourceDataSyncArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ResourceDataSyncArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ResourceDataSync Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ResourceDataSync resource accepts the following input properties:

S3Destination Pulumi.Aws.Ssm.Inputs.ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

Name string

Name for the configuration.

S3Destination ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

Name string

Name for the configuration.

s3Destination ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

name String

Name for the configuration.

s3Destination ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

name string

Name for the configuration.

s3_destination ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

name str

Name for the configuration.

s3Destination Property Map

Amazon S3 configuration details for the sync.

name String

Name for the configuration.

Outputs

All input properties are implicitly available as output properties. Additionally, the ResourceDataSync 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 ResourceDataSync Resource

Get an existing ResourceDataSync 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?: ResourceDataSyncState, opts?: CustomResourceOptions): ResourceDataSync
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        s3_destination: Optional[ResourceDataSyncS3DestinationArgs] = None) -> ResourceDataSync
func GetResourceDataSync(ctx *Context, name string, id IDInput, state *ResourceDataSyncState, opts ...ResourceOption) (*ResourceDataSync, error)
public static ResourceDataSync Get(string name, Input<string> id, ResourceDataSyncState? state, CustomResourceOptions? opts = null)
public static ResourceDataSync get(String name, Output<String> id, ResourceDataSyncState 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.
The following state arguments are supported:
Name string

Name for the configuration.

S3Destination Pulumi.Aws.Ssm.Inputs.ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

Name string

Name for the configuration.

S3Destination ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

name String

Name for the configuration.

s3Destination ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

name string

Name for the configuration.

s3Destination ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

name str

Name for the configuration.

s3_destination ResourceDataSyncS3DestinationArgs

Amazon S3 configuration details for the sync.

name String

Name for the configuration.

s3Destination Property Map

Amazon S3 configuration details for the sync.

Supporting Types

ResourceDataSyncS3Destination

BucketName string

Name of S3 bucket where the aggregated data is stored.

Region string

Region with the bucket targeted by the Resource Data Sync.

KmsKeyArn string

ARN of an encryption key for a destination in Amazon S3.

Prefix string

Prefix for the bucket.

SyncFormat string

A supported sync format. Only JsonSerDe is currently supported. Defaults to JsonSerDe.

BucketName string

Name of S3 bucket where the aggregated data is stored.

Region string

Region with the bucket targeted by the Resource Data Sync.

KmsKeyArn string

ARN of an encryption key for a destination in Amazon S3.

Prefix string

Prefix for the bucket.

SyncFormat string

A supported sync format. Only JsonSerDe is currently supported. Defaults to JsonSerDe.

bucketName String

Name of S3 bucket where the aggregated data is stored.

region String

Region with the bucket targeted by the Resource Data Sync.

kmsKeyArn String

ARN of an encryption key for a destination in Amazon S3.

prefix String

Prefix for the bucket.

syncFormat String

A supported sync format. Only JsonSerDe is currently supported. Defaults to JsonSerDe.

bucketName string

Name of S3 bucket where the aggregated data is stored.

region string

Region with the bucket targeted by the Resource Data Sync.

kmsKeyArn string

ARN of an encryption key for a destination in Amazon S3.

prefix string

Prefix for the bucket.

syncFormat string

A supported sync format. Only JsonSerDe is currently supported. Defaults to JsonSerDe.

bucket_name str

Name of S3 bucket where the aggregated data is stored.

region str

Region with the bucket targeted by the Resource Data Sync.

kms_key_arn str

ARN of an encryption key for a destination in Amazon S3.

prefix str

Prefix for the bucket.

sync_format str

A supported sync format. Only JsonSerDe is currently supported. Defaults to JsonSerDe.

bucketName String

Name of S3 bucket where the aggregated data is stored.

region String

Region with the bucket targeted by the Resource Data Sync.

kmsKeyArn String

ARN of an encryption key for a destination in Amazon S3.

prefix String

Prefix for the bucket.

syncFormat String

A supported sync format. Only JsonSerDe is currently supported. Defaults to JsonSerDe.

Import

SSM resource data sync can be imported using the name, e.g.,

 $ pulumi import aws:ssm/resourceDataSync:ResourceDataSync example example-name

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.