Protection Health Check Association Args
data class ProtectionHealthCheckAssociationArgs(val healthCheckArn: Output<String>? = null, val shieldProtectionId: Output<String>? = null) : ConvertibleToJava<ProtectionHealthCheckAssociationArgs>
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
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.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.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) {
final var currentRegion = AwsFunctions.getRegion();
final var currentCallerIdentity = AwsFunctions.getCallerIdentity();
final var currentPartition = AwsFunctions.getPartition();
var exampleEip = new Eip("exampleEip", EipArgs.builder()
.vpc(true)
.tags(Map.of("Name", "example"))
.build());
var exampleProtection = new Protection("exampleProtection", ProtectionArgs.builder()
.resourceArn(exampleEip.id().applyValue(id -> String.format("arn:%s:ec2:%s:%s:eip-allocation/%s", currentPartition.applyValue(getPartitionResult -> getPartitionResult.partition()),currentRegion.applyValue(getRegionResult -> getRegionResult.name()),currentCallerIdentity.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()),id)))
.build());
var exampleHealthCheck = new HealthCheck("exampleHealthCheck", HealthCheckArgs.builder()
.ipAddress(exampleEip.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());
}
}
Content copied to clipboard
Import
Shield protection health check association resources can be imported by specifying the shield_protection_id
and health_check_arn
e.g.,
$ pulumi import aws:shield/protectionHealthCheckAssociation:ProtectionHealthCheckAssociation example ff9592dc-22f3-4e88-afa1-7b29fde9669a+arn:aws:route53:::healthcheck/3742b175-edb9-46bc-9359-f53e3b794b1b
Content copied to clipboard