shield

package
v4.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 7 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/v4/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/shield"
"github.com/pulumi/pulumi/sdk/v3/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

func (*Protection) ElementType() reflect.Type

func (*Protection) ToProtectionOutput

func (i *Protection) ToProtectionOutput() ProtectionOutput

func (*Protection) ToProtectionOutputWithContext

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

func (*Protection) ToProtectionPtrOutput

func (i *Protection) ToProtectionPtrOutput() ProtectionPtrOutput

func (*Protection) ToProtectionPtrOutputWithContext

func (i *Protection) ToProtectionPtrOutputWithContext(ctx context.Context) ProtectionPtrOutput

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 ProtectionArray

type ProtectionArray []ProtectionInput

func (ProtectionArray) ElementType

func (ProtectionArray) ElementType() reflect.Type

func (ProtectionArray) ToProtectionArrayOutput

func (i ProtectionArray) ToProtectionArrayOutput() ProtectionArrayOutput

func (ProtectionArray) ToProtectionArrayOutputWithContext

func (i ProtectionArray) ToProtectionArrayOutputWithContext(ctx context.Context) ProtectionArrayOutput

type ProtectionArrayInput

type ProtectionArrayInput interface {
	pulumi.Input

	ToProtectionArrayOutput() ProtectionArrayOutput
	ToProtectionArrayOutputWithContext(context.Context) ProtectionArrayOutput
}

ProtectionArrayInput is an input type that accepts ProtectionArray and ProtectionArrayOutput values. You can construct a concrete instance of `ProtectionArrayInput` via:

ProtectionArray{ ProtectionArgs{...} }

type ProtectionArrayOutput

type ProtectionArrayOutput struct{ *pulumi.OutputState }

func (ProtectionArrayOutput) ElementType

func (ProtectionArrayOutput) ElementType() reflect.Type

func (ProtectionArrayOutput) Index

func (ProtectionArrayOutput) ToProtectionArrayOutput

func (o ProtectionArrayOutput) ToProtectionArrayOutput() ProtectionArrayOutput

func (ProtectionArrayOutput) ToProtectionArrayOutputWithContext

func (o ProtectionArrayOutput) ToProtectionArrayOutputWithContext(ctx context.Context) ProtectionArrayOutput

type ProtectionInput

type ProtectionInput interface {
	pulumi.Input

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

type ProtectionMap

type ProtectionMap map[string]ProtectionInput

func (ProtectionMap) ElementType

func (ProtectionMap) ElementType() reflect.Type

func (ProtectionMap) ToProtectionMapOutput

func (i ProtectionMap) ToProtectionMapOutput() ProtectionMapOutput

func (ProtectionMap) ToProtectionMapOutputWithContext

func (i ProtectionMap) ToProtectionMapOutputWithContext(ctx context.Context) ProtectionMapOutput

type ProtectionMapInput

type ProtectionMapInput interface {
	pulumi.Input

	ToProtectionMapOutput() ProtectionMapOutput
	ToProtectionMapOutputWithContext(context.Context) ProtectionMapOutput
}

ProtectionMapInput is an input type that accepts ProtectionMap and ProtectionMapOutput values. You can construct a concrete instance of `ProtectionMapInput` via:

ProtectionMap{ "key": ProtectionArgs{...} }

type ProtectionMapOutput

type ProtectionMapOutput struct{ *pulumi.OutputState }

func (ProtectionMapOutput) ElementType

func (ProtectionMapOutput) ElementType() reflect.Type

func (ProtectionMapOutput) MapIndex

func (ProtectionMapOutput) ToProtectionMapOutput

func (o ProtectionMapOutput) ToProtectionMapOutput() ProtectionMapOutput

func (ProtectionMapOutput) ToProtectionMapOutputWithContext

func (o ProtectionMapOutput) ToProtectionMapOutputWithContext(ctx context.Context) ProtectionMapOutput

type ProtectionOutput

type ProtectionOutput struct {
	*pulumi.OutputState
}

func (ProtectionOutput) ElementType

func (ProtectionOutput) ElementType() reflect.Type

func (ProtectionOutput) ToProtectionOutput

func (o ProtectionOutput) ToProtectionOutput() ProtectionOutput

func (ProtectionOutput) ToProtectionOutputWithContext

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

func (ProtectionOutput) ToProtectionPtrOutput

func (o ProtectionOutput) ToProtectionPtrOutput() ProtectionPtrOutput

func (ProtectionOutput) ToProtectionPtrOutputWithContext

func (o ProtectionOutput) ToProtectionPtrOutputWithContext(ctx context.Context) ProtectionPtrOutput

type ProtectionPtrInput

type ProtectionPtrInput interface {
	pulumi.Input

	ToProtectionPtrOutput() ProtectionPtrOutput
	ToProtectionPtrOutputWithContext(ctx context.Context) ProtectionPtrOutput
}

type ProtectionPtrOutput

type ProtectionPtrOutput struct {
	*pulumi.OutputState
}

func (ProtectionPtrOutput) ElementType

func (ProtectionPtrOutput) ElementType() reflect.Type

func (ProtectionPtrOutput) ToProtectionPtrOutput

func (o ProtectionPtrOutput) ToProtectionPtrOutput() ProtectionPtrOutput

func (ProtectionPtrOutput) ToProtectionPtrOutputWithContext

func (o ProtectionPtrOutput) ToProtectionPtrOutputWithContext(ctx context.Context) ProtectionPtrOutput

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