Class ProtectionHealthCheckAssociation


  • public class ProtectionHealthCheckAssociation
    extends com.pulumi.resources.CustomResource
    Creates an association between a Route53 Health Check and a Shield Advanced protected resource. This association uses the health of your applications to improve responsiveness and accuracy in attack detection and mitigation. Blog post: [AWS Shield Advanced now supports Health Based Detection](https://aws.amazon.com/about-aws/whats-new/2020/02/aws-shield-advanced-now-supports-health-based-detection/) ## Example Usage ### Create an association between a protected EIP and a Route53 Health Check
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.AwsFunctions;
     import com.pulumi.aws.inputs.GetRegionArgs;
     import com.pulumi.aws.inputs.GetCallerIdentityArgs;
     import com.pulumi.aws.inputs.GetPartitionArgs;
     import com.pulumi.aws.ec2.Eip;
     import com.pulumi.aws.ec2.EipArgs;
     import com.pulumi.aws.shield.Protection;
     import com.pulumi.aws.shield.ProtectionArgs;
     import com.pulumi.aws.route53.HealthCheck;
     import com.pulumi.aws.route53.HealthCheckArgs;
     import com.pulumi.aws.shield.ProtectionHealthCheckAssociation;
     import com.pulumi.aws.shield.ProtectionHealthCheckAssociationArgs;
     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) {
             final var current = AwsFunctions.getRegion(GetRegionArgs.builder()
                 .build());
     
             final var currentGetCallerIdentity = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder()
                 .build());
     
             final var currentGetPartition = AwsFunctions.getPartition(GetPartitionArgs.builder()
                 .build());
     
             var example = new Eip("example", EipArgs.builder()
                 .domain("vpc")
                 .tags(Map.of("Name", "example"))
                 .build());
     
             var exampleProtection = new Protection("exampleProtection", ProtectionArgs.builder()
                 .name("example-protection")
                 .resourceArn(example.id().applyValue(_id -> String.format("arn:%s:ec2:%s:%s:eip-allocation/%s", currentGetPartition.partition(),current.region(),currentGetCallerIdentity.accountId(),_id)))
                 .build());
     
             var exampleHealthCheck = new HealthCheck("exampleHealthCheck", HealthCheckArgs.builder()
                 .ipAddress(example.publicIp())
                 .port(80)
                 .type("HTTP")
                 .resourcePath("/ready")
                 .failureThreshold(3)
                 .requestInterval(30)
                 .tags(Map.of("Name", "tf-example-health-check"))
                 .build());
     
             var exampleProtectionHealthCheckAssociation = new ProtectionHealthCheckAssociation("exampleProtectionHealthCheckAssociation", ProtectionHealthCheckAssociationArgs.builder()
                 .healthCheckArn(exampleHealthCheck.arn())
                 .shieldProtectionId(exampleProtection.id())
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import Shield protection health check association resources using the `shieldProtectionId` and `healthCheckArn`. For example: ```sh $ pulumi import aws:shield/protectionHealthCheckAssociation:ProtectionHealthCheckAssociation example ff9592dc-22f3-4e88-afa1-7b29fde9669a+arn:aws:route53:::healthcheck/3742b175-edb9-46bc-9359-f53e3b794b1b ```
    • 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 ProtectionHealthCheckAssociation get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ProtectionHealthCheckAssociationState 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> healthCheckArn()  
      com.pulumi.core.Output<java.lang.String> shieldProtectionId()  
      • 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

      • ProtectionHealthCheckAssociation

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

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

        public ProtectionHealthCheckAssociation​(java.lang.String name,
                                                ProtectionHealthCheckAssociationArgs 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

      • healthCheckArn

        public com.pulumi.core.Output<java.lang.String> healthCheckArn()
        Returns:
        ARN of the Route53 Health Check resource which will be associated to the protected resource.
      • shieldProtectionId

        public com.pulumi.core.Output<java.lang.String> shieldProtectionId()
        Returns:
        The ID of the protected resource.
      • get

        public static ProtectionHealthCheckAssociation get​(java.lang.String name,
                                                           com.pulumi.core.Output<java.lang.String> id,
                                                           @Nullable
                                                           ProtectionHealthCheckAssociationState 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.