Class DeliveryChannel


  • public class DeliveryChannel
    extends com.pulumi.resources.CustomResource
    Provides an AWS Config Delivery Channel. > **Note:** Delivery Channel requires a Configuration Recorder to be present. Use of `dependsOn` (as shown below) is recommended to avoid race conditions. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.s3.Bucket;
     import com.pulumi.aws.s3.BucketArgs;
     import com.pulumi.aws.iam.IamFunctions;
     import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
     import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementArgs;
     import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementPrincipalArgs;
     import com.pulumi.aws.iam.Role;
     import com.pulumi.aws.iam.RoleArgs;
     import com.pulumi.aws.cfg.Recorder;
     import com.pulumi.aws.cfg.RecorderArgs;
     import com.pulumi.aws.cfg.DeliveryChannel;
     import com.pulumi.aws.cfg.DeliveryChannelArgs;
     import com.pulumi.aws.iam.RolePolicy;
     import com.pulumi.aws.iam.RolePolicyArgs;
     import com.pulumi.resources.CustomResourceOptions;
     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 b = new Bucket("b", BucketArgs.builder()
                 .bucket("example-awsconfig")
                 .forceDestroy(true)
                 .build());
     
             final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
                 .statements(GetPolicyDocumentStatementArgs.builder()
                     .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                         .type("Service")
                         .identifiers("config.amazonaws.com")
                         .build())
                     .effect("Allow")
                     .actions("sts:AssumeRole")
                     .build())
                 .build());
     
             var r = new Role("r", RoleArgs.builder()
                 .name("awsconfig-example")
                 .assumeRolePolicy(assumeRole.json())
                 .build());
     
             var fooRecorder = new Recorder("fooRecorder", RecorderArgs.builder()
                 .name("example")
                 .roleArn(r.arn())
                 .build());
     
             var foo = new DeliveryChannel("foo", DeliveryChannelArgs.builder()
                 .name("example")
                 .s3BucketName(b.bucket())
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(fooRecorder)
                     .build());
     
             final var p = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
                 .statements(GetPolicyDocumentStatementArgs.builder()
                     .effect("Allow")
                     .actions("s3:*")
                     .resources(                
                         b.arn(),
                         b.arn().applyValue(_arn -> String.format("%s/*", _arn)))
                     .build())
                 .build());
     
             var pRolePolicy = new RolePolicy("pRolePolicy", RolePolicyArgs.builder()
                 .name("awsconfig-example")
                 .role(r.id())
                 .policy(p.applyValue(_p -> _p.json()))
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `name` (String) Name of the delivery channel. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import Delivery Channels using the `name`. For example: ```sh $ pulumi import aws:cfg/deliveryChannel:DeliveryChannel example example ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DeliveryChannel get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, DeliveryChannelState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> s3BucketName()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> s3KeyPrefix()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> s3KmsKeyArn()  
      com.pulumi.core.Output<java.util.Optional<DeliveryChannelSnapshotDeliveryProperties>> snapshotDeliveryProperties()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> snsTopicArn()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeliveryChannel

        public DeliveryChannel​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • DeliveryChannel

        public DeliveryChannel​(java.lang.String name,
                               DeliveryChannelArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • DeliveryChannel

        public DeliveryChannel​(java.lang.String name,
                               DeliveryChannelArgs args,
                               @Nullable
                               com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the delivery channel. Defaults to `default`. Changing it recreates the resource.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • s3BucketName

        public com.pulumi.core.Output<java.lang.String> s3BucketName()
        Returns:
        The name of the S3 bucket used to store the configuration history.
      • s3KeyPrefix

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> s3KeyPrefix()
        Returns:
        The prefix for the specified S3 bucket.
      • s3KmsKeyArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> s3KmsKeyArn()
        Returns:
        The ARN of the AWS KMS key used to encrypt objects delivered by AWS Config. Must belong to the same Region as the destination S3 bucket.
      • snapshotDeliveryProperties

        public com.pulumi.core.Output<java.util.Optional<DeliveryChannelSnapshotDeliveryProperties>> snapshotDeliveryProperties()
        Returns:
        Options for how AWS Config delivers configuration snapshots. See below
      • snsTopicArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> snsTopicArn()
        Returns:
        The ARN of the SNS topic that AWS Config delivers notifications to.
      • get

        public static DeliveryChannel get​(java.lang.String name,
                                          com.pulumi.core.Output<java.lang.String> id,
                                          @Nullable
                                          DeliveryChannelState state,
                                          @Nullable
                                          com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.