shield

package
v3.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Protection

type Protection struct {
	pulumi.CustomResourceState

	// A friendly name for the Protection you are creating.
	Name pulumi.StringOutput `pulumi:"name"`
	// The ARN (Amazon Resource Name) of the resource to be protected.
	ResourceArn pulumi.StringOutput `pulumi:"resourceArn"`
}

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

```go package main

import (

"fmt"

"github.com/pulumi/pulumi-aws/sdk/v3/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/shield"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := aws.GetAvailabilityZones(ctx, nil, nil)
		if err != nil {
			return err
		}
		currentRegion, err := aws.GetRegion(ctx, nil, nil)
		if err != nil {
			return err
		}
		currentCallerIdentity, err := aws.GetCallerIdentity(ctx, nil, nil)
		if err != nil {
			return err
		}
		exampleEip, err := ec2.NewEip(ctx, "exampleEip", &ec2.EipArgs{
			Vpc: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = shield.NewProtection(ctx, "exampleProtection", &shield.ProtectionArgs{
			ResourceArn: exampleEip.ID().ApplyT(func(id string) (string, error) {
				return fmt.Sprintf("%v%v%v%v%v%v", "arn:aws:ec2:", currentRegion.Name, ":", currentCallerIdentity.AccountId, ":eip-allocation/", id), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

Shield protection resources can be imported by specifying their ID e.g.

```sh

$ pulumi import aws:shield/protection:Protection example ff9592dc-22f3-4e88-afa1-7b29fde9669a

```

func GetProtection

func GetProtection(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *ProtectionState, opts ...pulumi.ResourceOption) (*Protection, error)

GetProtection gets an existing Protection resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewProtection

func NewProtection(ctx *pulumi.Context,
	name string, args *ProtectionArgs, opts ...pulumi.ResourceOption) (*Protection, error)

NewProtection registers a new resource with the given unique name, arguments, and options.

func (Protection) ElementType added in v3.13.0

func (Protection) ElementType() reflect.Type

func (Protection) ToProtectionOutput added in v3.13.0

func (i Protection) ToProtectionOutput() ProtectionOutput

func (Protection) ToProtectionOutputWithContext added in v3.13.0

func (i Protection) ToProtectionOutputWithContext(ctx context.Context) ProtectionOutput

type ProtectionArgs

type ProtectionArgs struct {
	// A friendly name for the Protection you are creating.
	Name pulumi.StringPtrInput
	// The ARN (Amazon Resource Name) of the resource to be protected.
	ResourceArn pulumi.StringInput
}

The set of arguments for constructing a Protection resource.

func (ProtectionArgs) ElementType

func (ProtectionArgs) ElementType() reflect.Type

type ProtectionInput added in v3.13.0

type ProtectionInput interface {
	pulumi.Input

	ToProtectionOutput() ProtectionOutput
	ToProtectionOutputWithContext(ctx context.Context) ProtectionOutput
}

type ProtectionOutput added in v3.13.0

type ProtectionOutput struct {
	*pulumi.OutputState
}

func (ProtectionOutput) ElementType added in v3.13.0

func (ProtectionOutput) ElementType() reflect.Type

func (ProtectionOutput) ToProtectionOutput added in v3.13.0

func (o ProtectionOutput) ToProtectionOutput() ProtectionOutput

func (ProtectionOutput) ToProtectionOutputWithContext added in v3.13.0

func (o ProtectionOutput) ToProtectionOutputWithContext(ctx context.Context) ProtectionOutput

type ProtectionState

type ProtectionState struct {
	// A friendly name for the Protection you are creating.
	Name pulumi.StringPtrInput
	// The ARN (Amazon Resource Name) of the resource to be protected.
	ResourceArn pulumi.StringPtrInput
}

func (ProtectionState) ElementType

func (ProtectionState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL