Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

IPSet

Provides a resource to manage a GuardDuty IPSet.

Note: Currently in GuardDuty, users from member accounts cannot upload and further manage IPSets. IPSets that are uploaded by the primary account are imposed on GuardDuty functionality in its member accounts. See the GuardDuty API Documentation

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var primary = new Aws.GuardDuty.Detector("primary", new Aws.GuardDuty.DetectorArgs
        {
            Enable = true,
        });
        var bucket = new Aws.S3.Bucket("bucket", new Aws.S3.BucketArgs
        {
            Acl = "private",
        });
        var myIPSet = new Aws.S3.BucketObject("myIPSet", new Aws.S3.BucketObjectArgs
        {
            Acl = "public-read",
            Content = @"10.0.0.0/8
",
            Bucket = bucket.Id,
            Key = "MyIPSet",
        });
        var example = new Aws.GuardDuty.IPSet("example", new Aws.GuardDuty.IPSetArgs
        {
            Activate = true,
            DetectorId = primary.Id,
            Format = "TXT",
            Location = Output.Tuple(myIPSet.Bucket, myIPSet.Key).Apply(values =>
            {
                var bucket = values.Item1;
                var key = values.Item2;
                return $"https://s3.amazonaws.com/{bucket}/{key}";
            }),
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/guardduty"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		primary, err := guardduty.NewDetector(ctx, "primary", &guardduty.DetectorArgs{
			Enable: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		bucket, err := s3.NewBucket(ctx, "bucket", &s3.BucketArgs{
			Acl: pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		myIPSet, err := s3.NewBucketObject(ctx, "myIPSet", &s3.BucketObjectArgs{
			Acl:     pulumi.String("public-read"),
			Content: pulumi.String("10.0.0.0/8\n"),
			Bucket:  bucket.ID(),
			Key:     pulumi.String("MyIPSet"),
		})
		if err != nil {
			return err
		}
		_, err = guardduty.NewIPSet(ctx, "example", &guardduty.IPSetArgs{
			Activate:   pulumi.Bool(true),
			DetectorId: primary.ID(),
			Format:     pulumi.String("TXT"),
			Location: pulumi.All(myIPSet.Bucket, myIPSet.Key).ApplyT(func(_args []interface{}) (string, error) {
				bucket := _args[0].(string)
				key := _args[1].(string)
				return fmt.Sprintf("%v%v%v%v", "https://s3.amazonaws.com/", bucket, "/", key), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

primary = aws.guardduty.Detector("primary", enable=True)
bucket = aws.s3.Bucket("bucket", acl="private")
my_ip_set = aws.s3.BucketObject("myIPSet",
    acl="public-read",
    content="10.0.0.0/8\n",
    bucket=bucket.id,
    key="MyIPSet")
example = aws.guardduty.IPSet("example",
    activate=True,
    detector_id=primary.id,
    format="TXT",
    location=pulumi.Output.all(my_ip_set.bucket, my_ip_set.key).apply(lambda bucket, key: f"https://s3.amazonaws.com/{bucket}/{key}"))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const primary = new aws.guardduty.Detector("primary", {enable: true});
const bucket = new aws.s3.Bucket("bucket", {acl: "private"});
const myIPSet = new aws.s3.BucketObject("myIPSet", {
    acl: "public-read",
    content: "10.0.0.0/8\n",
    bucket: bucket.id,
    key: "MyIPSet",
});
const example = new aws.guardduty.IPSet("example", {
    activate: true,
    detectorId: primary.id,
    format: "TXT",
    location: pulumi.interpolate`https://s3.amazonaws.com/${myIPSet.bucket}/${myIPSet.key}`,
});

Create a IPSet Resource

new IPSet(name: string, args: IPSetArgs, opts?: CustomResourceOptions);
@overload
def IPSet(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          activate: Optional[bool] = None,
          detector_id: Optional[str] = None,
          format: Optional[str] = None,
          location: Optional[str] = None,
          name: Optional[str] = None,
          tags: Optional[Mapping[str, str]] = None)
@overload
def IPSet(resource_name: str,
          args: IPSetArgs,
          opts: Optional[ResourceOptions] = None)
func NewIPSet(ctx *Context, name string, args IPSetArgs, opts ...ResourceOption) (*IPSet, error)
public IPSet(string name, IPSetArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args IPSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args IPSetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args IPSetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args IPSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

IPSet Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The IPSet resource accepts the following input properties:

Activate bool
Specifies whether GuardDuty is to start using the uploaded IPSet.
DetectorId string
The detector ID of the GuardDuty.
Format string
The format of the file that contains the IPSet. Valid values: TXT | STIX | OTX_CSV | ALIEN_VAULT | PROOF_POINT | FIRE_EYE
Location string
The URI of the file that contains the IPSet.
Name string
The friendly name to identify the IPSet.
Tags Dictionary<string, string>
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.
Activate bool
Specifies whether GuardDuty is to start using the uploaded IPSet.
DetectorId string
The detector ID of the GuardDuty.
Format string
The format of the file that contains the IPSet. Valid values: TXT | STIX | OTX_CSV | ALIEN_VAULT | PROOF_POINT | FIRE_EYE
Location string
The URI of the file that contains the IPSet.
Name string
The friendly name to identify the IPSet.
Tags map[string]string
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.
activate boolean
Specifies whether GuardDuty is to start using the uploaded IPSet.
detectorId string
The detector ID of the GuardDuty.
format string
The format of the file that contains the IPSet. Valid values: TXT | STIX | OTX_CSV | ALIEN_VAULT | PROOF_POINT | FIRE_EYE
location string
The URI of the file that contains the IPSet.
name string
The friendly name to identify the IPSet.
tags {[key: string]: string}
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.
activate bool
Specifies whether GuardDuty is to start using the uploaded IPSet.
detector_id str
The detector ID of the GuardDuty.
format str
The format of the file that contains the IPSet. Valid values: TXT | STIX | OTX_CSV | ALIEN_VAULT | PROOF_POINT | FIRE_EYE
location str
The URI of the file that contains the IPSet.
name str
The friendly name to identify the IPSet.
tags Mapping[str, str]
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.

Outputs

All input properties are implicitly available as output properties. Additionally, the IPSet resource produces the following output properties:

Arn string
Amazon Resource Name (ARN) of the GuardDuty IPSet.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
Arn string
Amazon Resource Name (ARN) of the GuardDuty IPSet.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
arn string
Amazon Resource Name (ARN) of the GuardDuty IPSet.
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
arn str
Amazon Resource Name (ARN) of the GuardDuty IPSet.
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .

Look up an Existing IPSet Resource

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

public static get(name: string, id: Input<ID>, state?: IPSetState, opts?: CustomResourceOptions): IPSet
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        activate: Optional[bool] = None,
        arn: Optional[str] = None,
        detector_id: Optional[str] = None,
        format: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> IPSet
func GetIPSet(ctx *Context, name string, id IDInput, state *IPSetState, opts ...ResourceOption) (*IPSet, error)
public static IPSet Get(string name, Input<string> id, IPSetState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Activate bool
Specifies whether GuardDuty is to start using the uploaded IPSet.
Arn string
Amazon Resource Name (ARN) of the GuardDuty IPSet.
DetectorId string
The detector ID of the GuardDuty.
Format string
The format of the file that contains the IPSet. Valid values: TXT | STIX | OTX_CSV | ALIEN_VAULT | PROOF_POINT | FIRE_EYE
Location string
The URI of the file that contains the IPSet.
Name string
The friendly name to identify the IPSet.
Tags Dictionary<string, string>
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.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
Activate bool
Specifies whether GuardDuty is to start using the uploaded IPSet.
Arn string
Amazon Resource Name (ARN) of the GuardDuty IPSet.
DetectorId string
The detector ID of the GuardDuty.
Format string
The format of the file that contains the IPSet. Valid values: TXT | STIX | OTX_CSV | ALIEN_VAULT | PROOF_POINT | FIRE_EYE
Location string
The URI of the file that contains the IPSet.
Name string
The friendly name to identify the IPSet.
Tags map[string]string
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.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
activate boolean
Specifies whether GuardDuty is to start using the uploaded IPSet.
arn string
Amazon Resource Name (ARN) of the GuardDuty IPSet.
detectorId string
The detector ID of the GuardDuty.
format string
The format of the file that contains the IPSet. Valid values: TXT | STIX | OTX_CSV | ALIEN_VAULT | PROOF_POINT | FIRE_EYE
location string
The URI of the file that contains the IPSet.
name string
The friendly name to identify the IPSet.
tags {[key: string]: string}
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.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
activate bool
Specifies whether GuardDuty is to start using the uploaded IPSet.
arn str
Amazon Resource Name (ARN) of the GuardDuty IPSet.
detector_id str
The detector ID of the GuardDuty.
format str
The format of the file that contains the IPSet. Valid values: TXT | STIX | OTX_CSV | ALIEN_VAULT | PROOF_POINT | FIRE_EYE
location str
The URI of the file that contains the IPSet.
name str
The friendly name to identify the IPSet.
tags Mapping[str, str]
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.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .

Import

GuardDuty IPSet can be imported using the the primary GuardDuty detector ID and IPSet ID, e.g.

 $ pulumi import aws:guardduty/iPSet:IPSet MyIPSet 00b00fd5aecc0ab60a708659477e9617:123456789012

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.