Group

Provides a Resource Group.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Aws.ResourceGroups.Group("test", new Aws.ResourceGroups.GroupArgs
        {
            ResourceQuery = new Aws.ResourceGroups.Inputs.GroupResourceQueryArgs
            {
                Query = @"{
  ""ResourceTypeFilters"": [
    ""AWS::EC2::Instance""
  ],
  ""TagFilters"": [
    {
      ""Key"": ""Stage"",
      ""Values"": [""Test""]
    }
  ]
}

",
            },
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/resourcegroups"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := resourcegroups.NewGroup(ctx, "test", &resourcegroups.GroupArgs{
            ResourceQuery: &resourcegroups.GroupResourceQueryArgs{
                Query: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"ResourceTypeFilters\": [\n", "    \"AWS::EC2::Instance\"\n", "  ],\n", "  \"TagFilters\": [\n", "    {\n", "      \"Key\": \"Stage\",\n", "      \"Values\": [\"Test\"]\n", "    }\n", "  ]\n", "}\n", "\n")),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

test = aws.resourcegroups.Group("test", resource_query={
    "query": """{
  "ResourceTypeFilters": [
    "AWS::EC2::Instance"
  ],
  "TagFilters": [
    {
      "Key": "Stage",
      "Values": ["Test"]
    }
  ]
}

""",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.resourcegroups.Group("test", {
    resourceQuery: {
        query: `{
  "ResourceTypeFilters": [
    "AWS::EC2::Instance"
  ],
  "TagFilters": [
    {
      "Key": "Stage",
      "Values": ["Test"]
    }
  ]
}
`,
    },
});

Create a Group Resource

new Group(name: string, args: GroupArgs, opts?: CustomResourceOptions);
def Group(resource_name, opts=None, description=None, name=None, resource_query=None, tags=None, __props__=None);
func NewGroup(ctx *Context, name string, args GroupArgs, opts ...ResourceOption) (*Group, error)
public Group(string name, GroupArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Group Resource Properties

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

Inputs

The Group resource accepts the following input properties:

ResourceQuery GroupResourceQueryArgs

A resource_query block. Resource queries are documented below.

Description string

A description of the resource group.

Name string

The resource group’s name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws.

Tags Dictionary<string, string>

Key-value map of resource tags

ResourceQuery GroupResourceQuery

A resource_query block. Resource queries are documented below.

Description string

A description of the resource group.

Name string

The resource group’s name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws.

Tags map[string]string

Key-value map of resource tags

resourceQuery GroupResourceQuery

A resource_query block. Resource queries are documented below.

description string

A description of the resource group.

name string

The resource group’s name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws.

tags {[key: string]: string}

Key-value map of resource tags

resource_query Dict[GroupResourceQuery]

A resource_query block. Resource queries are documented below.

description str

A description of the resource group.

name str

The resource group’s name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws.

tags Dict[str, str]

Key-value map of resource tags

Outputs

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

Arn string

The ARN assigned by AWS for this resource group.

Id string
The provider-assigned unique ID for this managed resource.
Arn string

The ARN assigned by AWS for this resource group.

Id string
The provider-assigned unique ID for this managed resource.
arn string

The ARN assigned by AWS for this resource group.

id string
The provider-assigned unique ID for this managed resource.
arn str

The ARN assigned by AWS for this resource group.

id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Group Resource

Get an existing Group 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?: GroupState, opts?: CustomResourceOptions): Group
static get(resource_name, id, opts=None, arn=None, description=None, name=None, resource_query=None, tags=None, __props__=None);
func GetGroup(ctx *Context, name string, id IDInput, state *GroupState, opts ...ResourceOption) (*Group, error)
public static Group Get(string name, Input<string> id, GroupState? 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:

Arn string

The ARN assigned by AWS for this resource group.

Description string

A description of the resource group.

Name string

The resource group’s name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws.

ResourceQuery GroupResourceQueryArgs

A resource_query block. Resource queries are documented below.

Tags Dictionary<string, string>

Key-value map of resource tags

Arn string

The ARN assigned by AWS for this resource group.

Description string

A description of the resource group.

Name string

The resource group’s name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws.

ResourceQuery GroupResourceQuery

A resource_query block. Resource queries are documented below.

Tags map[string]string

Key-value map of resource tags

arn string

The ARN assigned by AWS for this resource group.

description string

A description of the resource group.

name string

The resource group’s name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws.

resourceQuery GroupResourceQuery

A resource_query block. Resource queries are documented below.

tags {[key: string]: string}

Key-value map of resource tags

arn str

The ARN assigned by AWS for this resource group.

description str

A description of the resource group.

name str

The resource group’s name. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws.

resource_query Dict[GroupResourceQuery]

A resource_query block. Resource queries are documented below.

tags Dict[str, str]

Key-value map of resource tags

Supporting Types

GroupResourceQuery

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Query string

The resource query as a JSON string.

Type string

The type of the resource query. Defaults to TAG_FILTERS_1_0.

Query string

The resource query as a JSON string.

Type string

The type of the resource query. Defaults to TAG_FILTERS_1_0.

query string

The resource query as a JSON string.

type string

The type of the resource query. Defaults to TAG_FILTERS_1_0.

query str

The resource query as a JSON string.

type str

The type of the resource query. Defaults to TAG_FILTERS_1_0.

Package Details

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