oci logo
Oracle Cloud Infrastructure v0.12.0, Mar 17 23

oci.Identity.DynamicGroup

This resource provides the Dynamic Group resource in Oracle Cloud Infrastructure Identity service.

Creates a new dynamic group in your tenancy.

You must specify your tenancy’s OCID as the compartment ID in the request object (remember that the tenancy is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies) reside within the tenancy itself, unlike cloud resources such as compute instances, which typically reside within compartments inside the tenancy. For information about OCIDs, see Resource Identifiers.

You must also specify a name for the dynamic group, which must be unique across all dynamic groups in your tenancy, and cannot be changed. Note that this name has to be also unique across all groups in your tenancy. You can use this name or the OCID when writing policies that apply to the dynamic group. For more information about policies, see How Policies Work.

You must also specify a description for the dynamic group (although it can be an empty string). It does not have to be unique, and you can change it anytime with UpdateDynamicGroup.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testDynamicGroup = new Oci.Identity.DynamicGroup("testDynamicGroup", new()
    {
        CompartmentId = @var.Tenancy_ocid,
        Description = @var.Dynamic_group_description,
        MatchingRule = @var.Dynamic_group_matching_rule,
        DefinedTags = 
        {
            { "Operations.CostCenter", "42" },
        },
        FreeformTags = 
        {
            { "Department", "Finance" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/go/oci/Identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Identity.NewDynamicGroup(ctx, "testDynamicGroup", &Identity.DynamicGroupArgs{
			CompartmentId: pulumi.Any(_var.Tenancy_ocid),
			Description:   pulumi.Any(_var.Dynamic_group_description),
			MatchingRule:  pulumi.Any(_var.Dynamic_group_matching_rule),
			DefinedTags: pulumi.AnyMap{
				"Operations.CostCenter": pulumi.Any("42"),
			},
			FreeformTags: pulumi.AnyMap{
				"Department": pulumi.Any("Finance"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.DynamicGroup;
import com.pulumi.oci.Identity.DynamicGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var testDynamicGroup = new DynamicGroup("testDynamicGroup", DynamicGroupArgs.builder()        
            .compartmentId(var_.tenancy_ocid())
            .description(var_.dynamic_group_description())
            .matchingRule(var_.dynamic_group_matching_rule())
            .definedTags(Map.of("Operations.CostCenter", "42"))
            .freeformTags(Map.of("Department", "Finance"))
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_dynamic_group = oci.identity.DynamicGroup("testDynamicGroup",
    compartment_id=var["tenancy_ocid"],
    description=var["dynamic_group_description"],
    matching_rule=var["dynamic_group_matching_rule"],
    defined_tags={
        "Operations.CostCenter": "42",
    },
    freeform_tags={
        "Department": "Finance",
    })
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testDynamicGroup = new oci.identity.DynamicGroup("testDynamicGroup", {
    compartmentId: _var.tenancy_ocid,
    description: _var.dynamic_group_description,
    matchingRule: _var.dynamic_group_matching_rule,
    definedTags: {
        "Operations.CostCenter": "42",
    },
    freeformTags: {
        Department: "Finance",
    },
});
resources:
  testDynamicGroup:
    type: oci:Identity:DynamicGroup
    properties:
      #Required
      compartmentId: ${var.tenancy_ocid}
      description: ${var.dynamic_group_description}
      matchingRule: ${var.dynamic_group_matching_rule}
      #Optional
      definedTags:
        Operations.CostCenter: '42'
      freeformTags:
        Department: Finance

Create DynamicGroup Resource

new DynamicGroup(name: string, args: DynamicGroupArgs, opts?: CustomResourceOptions);
@overload
def DynamicGroup(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 compartment_id: Optional[str] = None,
                 defined_tags: Optional[Mapping[str, Any]] = None,
                 description: Optional[str] = None,
                 freeform_tags: Optional[Mapping[str, Any]] = None,
                 matching_rule: Optional[str] = None,
                 name: Optional[str] = None)
@overload
def DynamicGroup(resource_name: str,
                 args: DynamicGroupArgs,
                 opts: Optional[ResourceOptions] = None)
func NewDynamicGroup(ctx *Context, name string, args DynamicGroupArgs, opts ...ResourceOption) (*DynamicGroup, error)
public DynamicGroup(string name, DynamicGroupArgs args, CustomResourceOptions? opts = null)
public DynamicGroup(String name, DynamicGroupArgs args)
public DynamicGroup(String name, DynamicGroupArgs args, CustomResourceOptions options)
type: oci:Identity:DynamicGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DynamicGroupArgs
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 DynamicGroupArgs
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 DynamicGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DynamicGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DynamicGroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DynamicGroup 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 DynamicGroup resource accepts the following input properties:

CompartmentId string

The OCID of the tenancy containing the group.

Description string

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

MatchingRule string

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

DefinedTags Dictionary<string, object>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

FreeformTags Dictionary<string, object>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

Name string

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

CompartmentId string

The OCID of the tenancy containing the group.

Description string

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

MatchingRule string

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

DefinedTags map[string]interface{}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

FreeformTags map[string]interface{}

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

Name string

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

compartmentId String

The OCID of the tenancy containing the group.

description String

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

matchingRule String

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

definedTags Map<String,Object>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

freeformTags Map<String,Object>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

name String

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

compartmentId string

The OCID of the tenancy containing the group.

description string

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

matchingRule string

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

definedTags {[key: string]: any}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

freeformTags {[key: string]: any}

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

name string

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

compartment_id str

The OCID of the tenancy containing the group.

description str

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

matching_rule str

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

defined_tags Mapping[str, Any]

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

freeform_tags Mapping[str, Any]

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

name str

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

compartmentId String

The OCID of the tenancy containing the group.

description String

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

matchingRule String

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

definedTags Map<Any>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

freeformTags Map<Any>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

name String

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

InactiveState string

The detailed status of INACTIVE lifecycleState.

State string

The group's current state.

TimeCreated string

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Id string

The provider-assigned unique ID for this managed resource.

InactiveState string

The detailed status of INACTIVE lifecycleState.

State string

The group's current state.

TimeCreated string

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

id String

The provider-assigned unique ID for this managed resource.

inactiveState String

The detailed status of INACTIVE lifecycleState.

state String

The group's current state.

timeCreated String

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

id string

The provider-assigned unique ID for this managed resource.

inactiveState string

The detailed status of INACTIVE lifecycleState.

state string

The group's current state.

timeCreated string

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

id str

The provider-assigned unique ID for this managed resource.

inactive_state str

The detailed status of INACTIVE lifecycleState.

state str

The group's current state.

time_created str

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

id String

The provider-assigned unique ID for this managed resource.

inactiveState String

The detailed status of INACTIVE lifecycleState.

state String

The group's current state.

timeCreated String

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Look up Existing DynamicGroup Resource

Get an existing DynamicGroup 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?: DynamicGroupState, opts?: CustomResourceOptions): DynamicGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        defined_tags: Optional[Mapping[str, Any]] = None,
        description: Optional[str] = None,
        freeform_tags: Optional[Mapping[str, Any]] = None,
        inactive_state: Optional[str] = None,
        matching_rule: Optional[str] = None,
        name: Optional[str] = None,
        state: Optional[str] = None,
        time_created: Optional[str] = None) -> DynamicGroup
func GetDynamicGroup(ctx *Context, name string, id IDInput, state *DynamicGroupState, opts ...ResourceOption) (*DynamicGroup, error)
public static DynamicGroup Get(string name, Input<string> id, DynamicGroupState? state, CustomResourceOptions? opts = null)
public static DynamicGroup get(String name, Output<String> id, DynamicGroupState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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:
CompartmentId string

The OCID of the tenancy containing the group.

DefinedTags Dictionary<string, object>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

Description string

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

FreeformTags Dictionary<string, object>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

InactiveState string

The detailed status of INACTIVE lifecycleState.

MatchingRule string

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

Name string

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

State string

The group's current state.

TimeCreated string

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

CompartmentId string

The OCID of the tenancy containing the group.

DefinedTags map[string]interface{}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

Description string

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

FreeformTags map[string]interface{}

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

InactiveState string

The detailed status of INACTIVE lifecycleState.

MatchingRule string

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

Name string

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

State string

The group's current state.

TimeCreated string

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

compartmentId String

The OCID of the tenancy containing the group.

definedTags Map<String,Object>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

description String

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

freeformTags Map<String,Object>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

inactiveState String

The detailed status of INACTIVE lifecycleState.

matchingRule String

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

name String

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

state String

The group's current state.

timeCreated String

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

compartmentId string

The OCID of the tenancy containing the group.

definedTags {[key: string]: any}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

description string

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

freeformTags {[key: string]: any}

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

inactiveState string

The detailed status of INACTIVE lifecycleState.

matchingRule string

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

name string

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

state string

The group's current state.

timeCreated string

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

compartment_id str

The OCID of the tenancy containing the group.

defined_tags Mapping[str, Any]

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

description str

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

freeform_tags Mapping[str, Any]

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

inactive_state str

The detailed status of INACTIVE lifecycleState.

matching_rule str

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

name str

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

state str

The group's current state.

time_created str

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

compartmentId String

The OCID of the tenancy containing the group.

definedTags Map<Any>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

description String

(Updatable) The description you assign to the group during creation. Does not have to be unique, and it's changeable.

freeformTags Map<Any>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

inactiveState String

The detailed status of INACTIVE lifecycleState.

matchingRule String

(Updatable) The matching rule to dynamically match an instance certificate to this dynamic group. For rule syntax, see Managing Dynamic Groups.

name String

The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed.

state String

The group's current state.

timeCreated String

Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Import

DynamicGroups can be imported using the id, e.g.

 $ pulumi import oci:Identity/dynamicGroup:DynamicGroup test_dynamic_group "id"

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.