ProtectionGroupArgs

data class ProtectionGroupArgs(val aggregation: Output<String>? = null, val members: Output<List<String>>? = null, val pattern: Output<String>? = null, val protectionGroupId: Output<String>? = null, val resourceType: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ProtectionGroupArgs>

Creates a grouping of protected resources so they can be handled as a collective. This resource grouping improves the accuracy of detection and reduces false positives. For more information see Managing AWS Shield Advanced protection groups

Example Usage

Create protection group for all resources

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.shield.ProtectionGroup;
import com.pulumi.aws.shield.ProtectionGroupArgs;
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) {
var example = new ProtectionGroup("example", ProtectionGroupArgs.builder()
.aggregation("MAX")
.pattern("ALL")
.protectionGroupId("example")
.build());
}
}

Create protection group for arbitrary number of resources

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.shield.ProtectionGroup;
import com.pulumi.aws.shield.ProtectionGroupArgs;
import com.pulumi.resources.CustomResourceOptions;
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();
var exampleEip = new Eip("exampleEip", EipArgs.builder()
.vpc(true)
.build());
var exampleProtection = new Protection("exampleProtection", ProtectionArgs.builder()
.resourceArn(exampleEip.id().applyValue(id -> String.format("arn:aws:ec2:%s:%s:eip-allocation/%s", currentRegion.applyValue(getRegionResult -> getRegionResult.name()),currentCallerIdentity.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()),id)))
.build());
var exampleProtectionGroup = new ProtectionGroup("exampleProtectionGroup", ProtectionGroupArgs.builder()
.protectionGroupId("example")
.aggregation("MEAN")
.pattern("ARBITRARY")
.members(exampleEip.id().applyValue(id -> String.format("arn:aws:ec2:%s:%s:eip-allocation/%s", currentRegion.applyValue(getRegionResult -> getRegionResult.name()),currentCallerIdentity.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()),id)))
.build(), CustomResourceOptions.builder()
.dependsOn(exampleProtection)
.build());
}
}

Create protection group for a type of resource

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.shield.ProtectionGroup;
import com.pulumi.aws.shield.ProtectionGroupArgs;
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) {
var example = new ProtectionGroup("example", ProtectionGroupArgs.builder()
.aggregation("SUM")
.pattern("BY_RESOURCE_TYPE")
.protectionGroupId("example")
.resourceType("ELASTIC_IP_ALLOCATION")
.build());
}
}

Import

Shield protection group resources can be imported by specifying their protection group id.

$ pulumi import aws:shield/protectionGroup:ProtectionGroup example example

Constructors

Link copied to clipboard
constructor(aggregation: Output<String>? = null, members: Output<List<String>>? = null, pattern: Output<String>? = null, protectionGroupId: Output<String>? = null, resourceType: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val aggregation: Output<String>? = null

Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.

Link copied to clipboard
val members: Output<List<String>>? = null

The Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set pattern to ARBITRARY and you must not set it for any other pattern setting.

Link copied to clipboard
val pattern: Output<String>? = null

The criteria to use to choose the protected resources for inclusion in the group.

Link copied to clipboard
val protectionGroupId: Output<String>? = null

The name of the protection group.

Link copied to clipboard
val resourceType: Output<String>? = null

The resource type to include in the protection group. You must set this when you set pattern to BY_RESOURCE_TYPE and you must not set it for any other pattern setting.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Functions

Link copied to clipboard
open override fun toJava(): ProtectionGroupArgs