@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
207 lines • 7.8 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Flow = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an AppFlow flow resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleSourceBucket = new aws.s3.Bucket("example_source", {bucket: "example-source"});
* const exampleSource = aws.iam.getPolicyDocument({
* statements: [{
* sid: "AllowAppFlowSourceActions",
* effect: "Allow",
* principals: [{
* type: "Service",
* identifiers: ["appflow.amazonaws.com"],
* }],
* actions: [
* "s3:ListBucket",
* "s3:GetObject",
* ],
* resources: [
* "arn:aws:s3:::example-source",
* "arn:aws:s3:::example-source/*",
* ],
* }],
* });
* const exampleSourceBucketPolicy = new aws.s3.BucketPolicy("example_source", {
* bucket: exampleSourceBucket.id,
* policy: exampleSource.then(exampleSource => exampleSource.json),
* });
* const example = new aws.s3.BucketObjectv2("example", {
* bucket: exampleSourceBucket.id,
* key: "example_source.csv",
* source: new pulumi.asset.FileAsset("example_source.csv"),
* });
* const exampleDestinationBucket = new aws.s3.Bucket("example_destination", {bucket: "example-destination"});
* const exampleDestination = aws.iam.getPolicyDocument({
* statements: [{
* sid: "AllowAppFlowDestinationActions",
* effect: "Allow",
* principals: [{
* type: "Service",
* identifiers: ["appflow.amazonaws.com"],
* }],
* actions: [
* "s3:PutObject",
* "s3:AbortMultipartUpload",
* "s3:ListMultipartUploadParts",
* "s3:ListBucketMultipartUploads",
* "s3:GetBucketAcl",
* "s3:PutObjectAcl",
* ],
* resources: [
* "arn:aws:s3:::example-destination",
* "arn:aws:s3:::example-destination/*",
* ],
* }],
* });
* const exampleDestinationBucketPolicy = new aws.s3.BucketPolicy("example_destination", {
* bucket: exampleDestinationBucket.id,
* policy: exampleDestination.then(exampleDestination => exampleDestination.json),
* });
* const exampleFlow = new aws.appflow.Flow("example", {
* name: "example",
* sourceFlowConfig: {
* connectorType: "S3",
* sourceConnectorProperties: {
* s3: {
* bucketName: exampleSourceBucketPolicy.bucket,
* bucketPrefix: "example",
* },
* },
* },
* destinationFlowConfigs: [{
* connectorType: "S3",
* destinationConnectorProperties: {
* s3: {
* bucketName: exampleDestinationBucketPolicy.bucket,
* s3OutputFormatConfig: {
* prefixConfig: {
* prefixType: "PATH",
* },
* },
* },
* },
* }],
* tasks: [{
* sourceFields: ["exampleField"],
* destinationField: "exampleField",
* taskType: "Map",
* connectorOperators: [{
* s3: "NO_OP",
* }],
* }],
* triggerConfig: {
* triggerType: "OnDemand",
* },
* });
* ```
*
* ## Import
*
* ### Identity Schema
*
* #### Required
*
* * `name` (String) Name of the AppFlow flow.
*
* #### Optional
*
* * `account_id` (String) AWS Account where this resource is managed.
*
* * `region` (String) Region where this resource is managed.
*
* Using `pulumi import`, import AppFlow flows using the `name`. For example:
*
* console
*
* % pulumi import aws_appflow_flow.example example-flow
*/
class Flow extends pulumi.CustomResource {
/**
* Get an existing Flow resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new Flow(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Flow. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Flow.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["description"] = state?.description;
resourceInputs["destinationFlowConfigs"] = state?.destinationFlowConfigs;
resourceInputs["flowStatus"] = state?.flowStatus;
resourceInputs["kmsArn"] = state?.kmsArn;
resourceInputs["metadataCatalogConfig"] = state?.metadataCatalogConfig;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["sourceFlowConfig"] = state?.sourceFlowConfig;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["tasks"] = state?.tasks;
resourceInputs["triggerConfig"] = state?.triggerConfig;
}
else {
const args = argsOrState;
if (args?.destinationFlowConfigs === undefined && !opts.urn) {
throw new Error("Missing required property 'destinationFlowConfigs'");
}
if (args?.sourceFlowConfig === undefined && !opts.urn) {
throw new Error("Missing required property 'sourceFlowConfig'");
}
if (args?.tasks === undefined && !opts.urn) {
throw new Error("Missing required property 'tasks'");
}
if (args?.triggerConfig === undefined && !opts.urn) {
throw new Error("Missing required property 'triggerConfig'");
}
resourceInputs["description"] = args?.description;
resourceInputs["destinationFlowConfigs"] = args?.destinationFlowConfigs;
resourceInputs["kmsArn"] = args?.kmsArn;
resourceInputs["metadataCatalogConfig"] = args?.metadataCatalogConfig;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["sourceFlowConfig"] = args?.sourceFlowConfig;
resourceInputs["tags"] = args?.tags;
resourceInputs["tasks"] = args?.tasks;
resourceInputs["triggerConfig"] = args?.triggerConfig;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["flowStatus"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Flow.__pulumiType, name, resourceInputs, opts);
}
}
exports.Flow = Flow;
/** @internal */
Flow.__pulumiType = 'aws:appflow/flow:Flow';
//# sourceMappingURL=flow.js.map