All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.appflow.Flow Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

There is a newer version: 6.72.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.appflow;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.appflow.FlowArgs;
import com.pulumi.aws.appflow.inputs.FlowState;
import com.pulumi.aws.appflow.outputs.FlowDestinationFlowConfig;
import com.pulumi.aws.appflow.outputs.FlowMetadataCatalogConfig;
import com.pulumi.aws.appflow.outputs.FlowSourceFlowConfig;
import com.pulumi.aws.appflow.outputs.FlowTask;
import com.pulumi.aws.appflow.outputs.FlowTriggerConfig;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Provides an AppFlow flow resource.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * 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.BucketV2Args;
 * import com.pulumi.aws.iam.IamFunctions;
 * import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
 * import com.pulumi.aws.s3.BucketPolicy;
 * import com.pulumi.aws.s3.BucketPolicyArgs;
 * import com.pulumi.aws.s3.BucketObjectv2;
 * import com.pulumi.aws.s3.BucketObjectv2Args;
 * import com.pulumi.aws.appflow.Flow;
 * import com.pulumi.aws.appflow.FlowArgs;
 * import com.pulumi.aws.appflow.inputs.FlowSourceFlowConfigArgs;
 * import com.pulumi.aws.appflow.inputs.FlowSourceFlowConfigSourceConnectorPropertiesArgs;
 * import com.pulumi.aws.appflow.inputs.FlowSourceFlowConfigSourceConnectorPropertiesS3Args;
 * import com.pulumi.aws.appflow.inputs.FlowDestinationFlowConfigArgs;
 * import com.pulumi.aws.appflow.inputs.FlowDestinationFlowConfigDestinationConnectorPropertiesArgs;
 * import com.pulumi.aws.appflow.inputs.FlowDestinationFlowConfigDestinationConnectorPropertiesS3Args;
 * import com.pulumi.aws.appflow.inputs.FlowDestinationFlowConfigDestinationConnectorPropertiesS3S3OutputFormatConfigArgs;
 * import com.pulumi.aws.appflow.inputs.FlowDestinationFlowConfigDestinationConnectorPropertiesS3S3OutputFormatConfigPrefixConfigArgs;
 * import com.pulumi.aws.appflow.inputs.FlowTaskArgs;
 * import com.pulumi.aws.appflow.inputs.FlowTriggerConfigArgs;
 * import com.pulumi.asset.FileAsset;
 * 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 exampleSourceBucketV2 = new BucketV2("exampleSourceBucketV2", BucketV2Args.builder()
 *             .bucket("example-source")
 *             .build());
 * 
 *         final var exampleSource = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
 *             .statements(GetPolicyDocumentStatementArgs.builder()
 *                 .sid("AllowAppFlowSourceActions")
 *                 .effect("Allow")
 *                 .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
 *                     .type("Service")
 *                     .identifiers("appflow.amazonaws.com")
 *                     .build())
 *                 .actions(                
 *                     "s3:ListBucket",
 *                     "s3:GetObject")
 *                 .resources(                
 *                     "arn:aws:s3:::example-source",
 *                     "arn:aws:s3:::example-source/*")
 *                 .build())
 *             .build());
 * 
 *         var exampleSourceBucketPolicy = new BucketPolicy("exampleSourceBucketPolicy", BucketPolicyArgs.builder()
 *             .bucket(exampleSourceBucketV2.id())
 *             .policy(exampleSource.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
 *             .build());
 * 
 *         var example = new BucketObjectv2("example", BucketObjectv2Args.builder()
 *             .bucket(exampleSourceBucketV2.id())
 *             .key("example_source.csv")
 *             .source(new FileAsset("example_source.csv"))
 *             .build());
 * 
 *         var exampleDestinationBucketV2 = new BucketV2("exampleDestinationBucketV2", BucketV2Args.builder()
 *             .bucket("example-destination")
 *             .build());
 * 
 *         final var exampleDestination = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
 *             .statements(GetPolicyDocumentStatementArgs.builder()
 *                 .sid("AllowAppFlowDestinationActions")
 *                 .effect("Allow")
 *                 .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
 *                     .type("Service")
 *                     .identifiers("appflow.amazonaws.com")
 *                     .build())
 *                 .actions(                
 *                     "s3:PutObject",
 *                     "s3:AbortMultipartUpload",
 *                     "s3:ListMultipartUploadParts",
 *                     "s3:ListBucketMultipartUploads",
 *                     "s3:GetBucketAcl",
 *                     "s3:PutObjectAcl")
 *                 .resources(                
 *                     "arn:aws:s3:::example-destination",
 *                     "arn:aws:s3:::example-destination/*")
 *                 .build())
 *             .build());
 * 
 *         var exampleDestinationBucketPolicy = new BucketPolicy("exampleDestinationBucketPolicy", BucketPolicyArgs.builder()
 *             .bucket(exampleDestinationBucketV2.id())
 *             .policy(exampleDestination.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
 *             .build());
 * 
 *         var exampleFlow = new Flow("exampleFlow", FlowArgs.builder()
 *             .name("example")
 *             .sourceFlowConfig(FlowSourceFlowConfigArgs.builder()
 *                 .connectorType("S3")
 *                 .sourceConnectorProperties(FlowSourceFlowConfigSourceConnectorPropertiesArgs.builder()
 *                     .s3(FlowSourceFlowConfigSourceConnectorPropertiesS3Args.builder()
 *                         .bucketName(exampleSourceBucketPolicy.bucket())
 *                         .bucketPrefix("example")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .destinationFlowConfigs(FlowDestinationFlowConfigArgs.builder()
 *                 .connectorType("S3")
 *                 .destinationConnectorProperties(FlowDestinationFlowConfigDestinationConnectorPropertiesArgs.builder()
 *                     .s3(FlowDestinationFlowConfigDestinationConnectorPropertiesS3Args.builder()
 *                         .bucketName(exampleDestinationBucketPolicy.bucket())
 *                         .s3OutputFormatConfig(FlowDestinationFlowConfigDestinationConnectorPropertiesS3S3OutputFormatConfigArgs.builder()
 *                             .prefixConfig(FlowDestinationFlowConfigDestinationConnectorPropertiesS3S3OutputFormatConfigPrefixConfigArgs.builder()
 *                                 .prefixType("PATH")
 *                                 .build())
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .build())
 *             .tasks(FlowTaskArgs.builder()
 *                 .sourceFields("exampleField")
 *                 .destinationField("exampleField")
 *                 .taskType("Map")
 *                 .connectorOperators(FlowTaskConnectorOperatorArgs.builder()
 *                     .s3("NO_OP")
 *                     .build())
 *                 .build())
 *             .triggerConfig(FlowTriggerConfigArgs.builder()
 *                 .triggerType("OnDemand")
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Using `pulumi import`, import AppFlow flows using the `arn`. For example: * * ```sh * $ pulumi import aws:appflow/flow:Flow example arn:aws:appflow:us-west-2:123456789012:flow/example-flow * ``` * */ @ResourceType(type="aws:appflow/flow:Flow") public class Flow extends com.pulumi.resources.CustomResource { /** * Flow's ARN. * */ @Export(name="arn", refs={String.class}, tree="[0]") private Output arn; /** * @return Flow's ARN. * */ public Output arn() { return this.arn; } /** * Description of the flow you want to create. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return Description of the flow you want to create. * */ public Output> description() { return Codegen.optional(this.description); } /** * A Destination Flow Config that controls how Amazon AppFlow places data in the destination connector. * */ @Export(name="destinationFlowConfigs", refs={List.class,FlowDestinationFlowConfig.class}, tree="[0,1]") private Output> destinationFlowConfigs; /** * @return A Destination Flow Config that controls how Amazon AppFlow places data in the destination connector. * */ public Output> destinationFlowConfigs() { return this.destinationFlowConfigs; } /** * The current status of the flow. * */ @Export(name="flowStatus", refs={String.class}, tree="[0]") private Output flowStatus; /** * @return The current status of the flow. * */ public Output flowStatus() { return this.flowStatus; } /** * ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here, Amazon AppFlow uses the Amazon AppFlow-managed KMS key. * */ @Export(name="kmsArn", refs={String.class}, tree="[0]") private Output kmsArn; /** * @return ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here, Amazon AppFlow uses the Amazon AppFlow-managed KMS key. * */ public Output kmsArn() { return this.kmsArn; } /** * A Catalog that determines the configuration that Amazon AppFlow uses when it catalogs the data that’s transferred by the associated flow. When Amazon AppFlow catalogs the data from a flow, it stores metadata in a data catalog. * */ @Export(name="metadataCatalogConfig", refs={FlowMetadataCatalogConfig.class}, tree="[0]") private Output metadataCatalogConfig; /** * @return A Catalog that determines the configuration that Amazon AppFlow uses when it catalogs the data that’s transferred by the associated flow. When Amazon AppFlow catalogs the data from a flow, it stores metadata in a data catalog. * */ public Output metadataCatalogConfig() { return this.metadataCatalogConfig; } /** * Name of the flow. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Name of the flow. * */ public Output name() { return this.name; } /** * The Source Flow Config that controls how Amazon AppFlow retrieves data from the source connector. * */ @Export(name="sourceFlowConfig", refs={FlowSourceFlowConfig.class}, tree="[0]") private Output sourceFlowConfig; /** * @return The Source Flow Config that controls how Amazon AppFlow retrieves data from the source connector. * */ public Output sourceFlowConfig() { return this.sourceFlowConfig; } /** * Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * * @deprecated * Please use `tags` instead. * */ @Deprecated /* Please use `tags` instead. */ @Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tagsAll; /** * @return Map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * */ public Output> tagsAll() { return this.tagsAll; } /** * A Task that Amazon AppFlow performs while transferring the data in the flow run. * */ @Export(name="tasks", refs={List.class,FlowTask.class}, tree="[0,1]") private Output> tasks; /** * @return A Task that Amazon AppFlow performs while transferring the data in the flow run. * */ public Output> tasks() { return this.tasks; } /** * A Trigger that determine how and when the flow runs. * */ @Export(name="triggerConfig", refs={FlowTriggerConfig.class}, tree="[0]") private Output triggerConfig; /** * @return A Trigger that determine how and when the flow runs. * */ public Output triggerConfig() { return this.triggerConfig; } /** * * @param name The _unique_ name of the resulting resource. */ public Flow(java.lang.String name) { this(name, FlowArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Flow(java.lang.String name, FlowArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public Flow(java.lang.String name, FlowArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:appflow/flow:Flow", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Flow(java.lang.String name, Output id, @Nullable FlowState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:appflow/flow:Flow", name, state, makeResourceOptions(options, id), false); } private static FlowArgs makeArgs(FlowArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? FlowArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host 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 * @param options Optional settings to control the behavior of the CustomResource. */ public static Flow get(java.lang.String name, Output id, @Nullable FlowState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Flow(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy