ApplicationLayerAutomaticResponse class
Resource for managing an AWS Shield Application Layer Automatic Response for automatic DDoS mitigation.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getRegion({});
const currentGetCallerIdentity = aws.getCallerIdentity({});
const currentGetPartition = aws.getPartition({});
const config = new pulumi.Config();
// The Cloudfront Distribution on which to enable the Application Layer Automatic Response.
const distributionId = config.require("distributionId");
const example = new aws.shield.ApplicationLayerAutomaticResponse("example", {
resourceArn: Promise.all([currentGetPartition, currentGetCallerIdentity]).then(([currentGetPartition, currentGetCallerIdentity]) => `arn:${currentGetPartition.partition}:cloudfront:${currentGetCallerIdentity.accountId}:distribution/${distributionId}`),
action: "COUNT",
});
import pulumi
import pulumi_aws as aws
current = aws.get_region()
current_get_caller_identity = aws.get_caller_identity()
current_get_partition = aws.get_partition()
config = pulumi.Config()
# The Cloudfront Distribution on which to enable the Application Layer Automatic Response.
distribution_id = config.require("distributionId")
example = aws.shield.ApplicationLayerAutomaticResponse("example",
resource_arn=f"arn:{current_get_partition.partition}:cloudfront:{current_get_caller_identity.account_id}:distribution/{distribution_id}",
action="COUNT")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.GetRegion.Invoke();
var currentGetCallerIdentity = Aws.GetCallerIdentity.Invoke();
var currentGetPartition = Aws.GetPartition.Invoke();
var config = new Config();
// The Cloudfront Distribution on which to enable the Application Layer Automatic Response.
var distributionId = config.Require("distributionId");
var example = new Aws.Shield.ApplicationLayerAutomaticResponse("example", new()
{
ResourceArn = Output.Tuple(currentGetPartition, currentGetCallerIdentity).Apply(values =>
{
var currentGetPartition = values.Item1;
var currentGetCallerIdentity = values.Item2;
return $"arn:{currentGetPartition.Apply(getPartitionResult => getPartitionResult.Partition)}:cloudfront:{currentGetCallerIdentity.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId)}:distribution/{distributionId}";
}),
Action = "COUNT",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/shield"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aws.GetRegion(ctx, &aws.GetRegionArgs{}, nil)
if err != nil {
return err
}
currentGetCallerIdentity, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
if err != nil {
return err
}
currentGetPartition, err := aws.GetPartition(ctx, &aws.GetPartitionArgs{}, nil)
if err != nil {
return err
}
cfg := config.New(ctx, "")
// The Cloudfront Distribution on which to enable the Application Layer Automatic Response.
distributionId := cfg.Require("distributionId")
_, err = shield.NewApplicationLayerAutomaticResponse(ctx, "example", &shield.ApplicationLayerAutomaticResponseArgs{
ResourceArn: pulumi.Sprintf("arn:%v:cloudfront:%v:distribution/%v", currentGetPartition.Partition, currentGetCallerIdentity.AccountId, distributionId),
Action: pulumi.String("COUNT"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_getregion" "current" {
}
data "aws_getcalleridentity" "currentGetCallerIdentity" {
}
data "aws_getpartition" "currentGetPartition" {
}
resource "aws_shield_applicationlayerautomaticresponse" "example" {
resource_arn ="arn:${data.aws_getpartition.currentGetPartition.partition}:cloudfront:${data.aws_getcalleridentity.currentGetCallerIdentity.account_id}:distribution/${var.distributionId}"
action = "COUNT"
}
variable "distributionId" {
type = string
description = "The Cloudfront Distribution on which to enable the Application Layer Automatic Response."
}
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.shield.ApplicationLayerAutomaticResponse;
import com.pulumi.aws.shield.ApplicationLayerAutomaticResponseArgs;
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 config = ctx.config();
final var current = AwsFunctions.getRegion(GetRegionArgs.builder()
.build());
final var currentGetCallerIdentity = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder()
.build());
final var currentGetPartition = AwsFunctions.getPartition(GetPartitionArgs.builder()
.build());
final var distributionId = config.require("distributionId");
var example = new ApplicationLayerAutomaticResponse("example", ApplicationLayerAutomaticResponseArgs.builder()
.resourceArn(String.format("arn:%s:cloudfront:%s:distribution/%s", currentGetPartition.partition(),currentGetCallerIdentity.accountId(),distributionId))
.action("COUNT")
.build());
}
}
configuration:
distributionId:
type: string
resources:
example:
type: aws:shield:ApplicationLayerAutomaticResponse
properties:
resourceArn: arn:${currentGetPartition.partition}:cloudfront:${currentGetCallerIdentity.accountId}:distribution/${distributionId}
action: COUNT
variables:
current:
fn::invoke:
function: aws:getRegion
arguments: {}
currentGetCallerIdentity:
fn::invoke:
function: aws:getCallerIdentity
arguments: {}
currentGetPartition:
fn::invoke:
function: aws:getPartition
arguments: {}
Constructors
- ApplicationLayerAutomaticResponse(String name, {ApplicationLayerAutomaticResponseArgs? args, CustomResourceOptions? options})
-
Creates a new ApplicationLayerAutomaticResponse.
nameThe Pulumi resource name.argsArguments used to configure this ApplicationLayerAutomaticResponse. The set of arguments for ApplicationLayerAutomaticResponse.optionsResource options controlling this resource's behavior. - ApplicationLayerAutomaticResponse.reference(String urn)
- Creates a typed reference to an existing ApplicationLayerAutomaticResponse resource.
Properties
-
action
↔ Output<
String> -
One of
COUNTorBLOCKlatefinal -
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
resourceArn
↔ Output<
String> -
ARN of the resource to protect (Cloudfront Distributions and ALBs only at this time).
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
timeouts
↔ Output<
ApplicationLayerAutomaticResponseTimeouts?> -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {ApplicationLayerAutomaticResponseState? state, CustomResourceOptions? options}) → ApplicationLayerAutomaticResponse -
Gets an existing ApplicationLayerAutomaticResponse resource's state with the given
nameandid.