Show / Hide Table of Contents

Class Protection

Enables AWS Shield Advanced for a specific AWS resource. The resource can be an Amazon CloudFront distribution, Elastic Load Balancing load balancer, AWS Global Accelerator accelerator, Elastic IP Address, or an Amazon Route 53 hosted zone.

Example Usage

Create protection

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var available = Output.Create(Aws.GetAvailabilityZones.InvokeAsync());
    var currentRegion = Output.Create(Aws.GetRegion.InvokeAsync());
    var currentCallerIdentity = Output.Create(Aws.GetCallerIdentity.InvokeAsync());
    var fooEip = new Aws.Ec2.Eip("fooEip", new Aws.Ec2.EipArgs
    {
        Vpc = true,
    });
    var fooProtection = new Aws.Shield.Protection("fooProtection", new Aws.Shield.ProtectionArgs
    {
        ResourceArn = Output.Tuple(currentRegion, currentCallerIdentity, fooEip.Id).Apply(values =>
        {
            var currentRegion = values.Item1;
            var currentCallerIdentity = values.Item2;
            var id = values.Item3;
            return $"arn:aws:ec2:{currentRegion.Name}:{currentCallerIdentity.AccountId}:eip-allocation/{id}";
        }),
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Protection
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Shield
Assembly: Pulumi.Aws.dll
Syntax
public class Protection : CustomResource

Constructors

View Source

Protection(String, ProtectionArgs, CustomResourceOptions)

Create a Protection resource with the given unique name, arguments, and options.

Declaration
public Protection(string name, ProtectionArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

ProtectionArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Name

A friendly name for the Protection you are creating.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

ResourceArn

The ARN (Amazon Resource Name) of the resource to be protected.

Declaration
public Output<string> ResourceArn { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, ProtectionState, CustomResourceOptions)

Get an existing Protection resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Protection Get(string name, Input<string> id, ProtectionState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

ProtectionState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Protection
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.