Package com.pulumi.aws.shield
Class ProtectionHealthCheckAssociation
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.shield.ProtectionHealthCheckAssociation
-
public class ProtectionHealthCheckAssociation extends com.pulumi.resources.CustomResourceCreates 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
## 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 ```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()); } }
-
-
Constructor Summary
Constructors Constructor Description ProtectionHealthCheckAssociation(java.lang.String name)ProtectionHealthCheckAssociation(java.lang.String name, ProtectionHealthCheckAssociationArgs args)ProtectionHealthCheckAssociation(java.lang.String name, ProtectionHealthCheckAssociationArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtectionHealthCheckAssociationget(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()
-
-
-
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.
-
-