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);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:
- Resource
Query GroupResource Query Args A
resource_queryblock. 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
AWSoraws.- Dictionary<string, string>
Key-value map of resource tags
- Resource
Query GroupResource Query A
resource_queryblock. 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
AWSoraws.- map[string]string
Key-value map of resource tags
- resource
Query GroupResource Query A
resource_queryblock. 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
AWSoraws.- {[key: string]: string}
Key-value map of resource tags
- resource_
query Dict[GroupResource Query] A
resource_queryblock. 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
AWSoraws.- 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:
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): Groupstatic 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
AWSoraws.- Resource
Query GroupResource Query Args A
resource_queryblock. Resource queries are documented below.- 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
AWSoraws.- Resource
Query GroupResource Query A
resource_queryblock. Resource queries are documented below.- 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
AWSoraws.- resource
Query GroupResource Query A
resource_queryblock. Resource queries are documented below.- {[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
AWSoraws.- resource_
query Dict[GroupResource Query] A
resource_queryblock. Resource queries are documented below.- Dict[str, str]
Key-value map of resource tags
Supporting Types
GroupResourceQuery
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.