1. Packages
  2. Packages
  3. Datadog Provider
  4. API Docs
  5. OrgGroupMembership
Viewing docs for Datadog v5.3.0
published on Friday, May 22, 2026 by Pulumi
datadog logo
Viewing docs for Datadog v5.3.0
published on Friday, May 22, 2026 by Pulumi

    Provides a Datadog Org Group Membership resource. This can be used to manage an organization’s membership in an org group.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const prod = new datadog.OrgGroup("prod", {name: "Production Environments"});
    // Moves the given organization into the prod org group.
    const example = new datadog.OrgGroupMembership("example", {
        orgGroupId: prod.id,
        orgUuid: "ff4a8255-6931-58d1-add0-a6b3602d5421",
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    prod = datadog.OrgGroup("prod", name="Production Environments")
    # Moves the given organization into the prod org group.
    example = datadog.OrgGroupMembership("example",
        org_group_id=prod.id,
        org_uuid="ff4a8255-6931-58d1-add0-a6b3602d5421")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v5/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		prod, err := datadog.NewOrgGroup(ctx, "prod", &datadog.OrgGroupArgs{
    			Name: pulumi.String("Production Environments"),
    		})
    		if err != nil {
    			return err
    		}
    		// Moves the given organization into the prod org group.
    		_, err = datadog.NewOrgGroupMembership(ctx, "example", &datadog.OrgGroupMembershipArgs{
    			OrgGroupId: prod.ID(),
    			OrgUuid:    pulumi.String("ff4a8255-6931-58d1-add0-a6b3602d5421"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        var prod = new Datadog.OrgGroup("prod", new()
        {
            Name = "Production Environments",
        });
    
        // Moves the given organization into the prod org group.
        var example = new Datadog.OrgGroupMembership("example", new()
        {
            OrgGroupId = prod.Id,
            OrgUuid = "ff4a8255-6931-58d1-add0-a6b3602d5421",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.OrgGroup;
    import com.pulumi.datadog.OrgGroupArgs;
    import com.pulumi.datadog.OrgGroupMembership;
    import com.pulumi.datadog.OrgGroupMembershipArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 prod = new OrgGroup("prod", OrgGroupArgs.builder()
                .name("Production Environments")
                .build());
    
            // Moves the given organization into the prod org group.
            var example = new OrgGroupMembership("example", OrgGroupMembershipArgs.builder()
                .orgGroupId(prod.id())
                .orgUuid("ff4a8255-6931-58d1-add0-a6b3602d5421")
                .build());
    
        }
    }
    
    resources:
      prod:
        type: datadog:OrgGroup
        properties:
          name: Production Environments
      # Moves the given organization into the prod org group.
      example:
        type: datadog:OrgGroupMembership
        properties:
          orgGroupId: ${prod.id}
          orgUuid: ff4a8255-6931-58d1-add0-a6b3602d5421
    
    pulumi {
      required_providers {
        datadog = {
          source = "pulumi/datadog"
        }
      }
    }
    
    resource "datadog_orggroup" "prod" {
      name = "Production Environments"
    }
    # Moves the given organization into the prod org group.
    resource "datadog_orggroupmembership" "example" {
      org_group_id = datadog_orggroup.prod.id
      org_uuid     = "ff4a8255-6931-58d1-add0-a6b3602d5421"
    }
    

    Behavior notes

    In-place moves vs. replacement

    Changing orgGroupId moves the organization between groups in place via the server’s membership-update endpoint. The resource is not re-created. Changing orgUuid triggers replacement because the resource represents a specific org’s membership.

    State-only destroy

    Destroying this resource is state-only: Terraform removes the resource from its state without calling an API, because the server has no endpoint to “delete” a membership outright. The organization stays in its current group until another datadog.OrgGroupMembership resource (or an out-of-band API call) moves it.

    Because of this, destroying a datadog.OrgGroup requires that it has zero memberships pointing at it. Before destroying a group, move every member org to another group first, either by updating orgGroupId on each membership resource (in-place reassignment) or by removing the member-org configs so Terraform reassigns them elsewhere.

    Create OrgGroupMembership Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new OrgGroupMembership(name: string, args: OrgGroupMembershipArgs, opts?: CustomResourceOptions);
    @overload
    def OrgGroupMembership(resource_name: str,
                           args: OrgGroupMembershipArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrgGroupMembership(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           org_group_id: Optional[str] = None,
                           org_uuid: Optional[str] = None)
    func NewOrgGroupMembership(ctx *Context, name string, args OrgGroupMembershipArgs, opts ...ResourceOption) (*OrgGroupMembership, error)
    public OrgGroupMembership(string name, OrgGroupMembershipArgs args, CustomResourceOptions? opts = null)
    public OrgGroupMembership(String name, OrgGroupMembershipArgs args)
    public OrgGroupMembership(String name, OrgGroupMembershipArgs args, CustomResourceOptions options)
    
    type: datadog:OrgGroupMembership
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "datadog_orggroupmembership" "name" {
        # resource properties
    }

    Parameters

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

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var orgGroupMembershipResource = new Datadog.OrgGroupMembership("orgGroupMembershipResource", new()
    {
        OrgGroupId = "string",
        OrgUuid = "string",
    });
    
    example, err := datadog.NewOrgGroupMembership(ctx, "orgGroupMembershipResource", &datadog.OrgGroupMembershipArgs{
    	OrgGroupId: pulumi.String("string"),
    	OrgUuid:    pulumi.String("string"),
    })
    
    resource "datadog_orggroupmembership" "orgGroupMembershipResource" {
      org_group_id = "string"
      org_uuid     = "string"
    }
    
    var orgGroupMembershipResource = new OrgGroupMembership("orgGroupMembershipResource", OrgGroupMembershipArgs.builder()
        .orgGroupId("string")
        .orgUuid("string")
        .build());
    
    org_group_membership_resource = datadog.OrgGroupMembership("orgGroupMembershipResource",
        org_group_id="string",
        org_uuid="string")
    
    const orgGroupMembershipResource = new datadog.OrgGroupMembership("orgGroupMembershipResource", {
        orgGroupId: "string",
        orgUuid: "string",
    });
    
    type: datadog:OrgGroupMembership
    properties:
        orgGroupId: string
        orgUuid: string
    

    OrgGroupMembership Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The OrgGroupMembership resource accepts the following input properties:

    OrgGroupId string
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    OrgUuid string
    The UUID of the organization. Must be a valid UUID.
    OrgGroupId string
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    OrgUuid string
    The UUID of the organization. Must be a valid UUID.
    org_group_id string
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    org_uuid string
    The UUID of the organization. Must be a valid UUID.
    orgGroupId String
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    orgUuid String
    The UUID of the organization. Must be a valid UUID.
    orgGroupId string
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    orgUuid string
    The UUID of the organization. Must be a valid UUID.
    org_group_id str
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    org_uuid str
    The UUID of the organization. Must be a valid UUID.
    orgGroupId String
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    orgUuid String
    The UUID of the organization. Must be a valid UUID.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    OrgName string
    The name of the organization.
    OrgSite string
    The site of the organization. Server-managed (derived from the organization's own settings).
    Id string
    The provider-assigned unique ID for this managed resource.
    OrgName string
    The name of the organization.
    OrgSite string
    The site of the organization. Server-managed (derived from the organization's own settings).
    id string
    The provider-assigned unique ID for this managed resource.
    org_name string
    The name of the organization.
    org_site string
    The site of the organization. Server-managed (derived from the organization's own settings).
    id String
    The provider-assigned unique ID for this managed resource.
    orgName String
    The name of the organization.
    orgSite String
    The site of the organization. Server-managed (derived from the organization's own settings).
    id string
    The provider-assigned unique ID for this managed resource.
    orgName string
    The name of the organization.
    orgSite string
    The site of the organization. Server-managed (derived from the organization's own settings).
    id str
    The provider-assigned unique ID for this managed resource.
    org_name str
    The name of the organization.
    org_site str
    The site of the organization. Server-managed (derived from the organization's own settings).
    id String
    The provider-assigned unique ID for this managed resource.
    orgName String
    The name of the organization.
    orgSite String
    The site of the organization. Server-managed (derived from the organization's own settings).

    Look up Existing OrgGroupMembership Resource

    Get an existing OrgGroupMembership 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?: OrgGroupMembershipState, opts?: CustomResourceOptions): OrgGroupMembership
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            org_group_id: Optional[str] = None,
            org_name: Optional[str] = None,
            org_site: Optional[str] = None,
            org_uuid: Optional[str] = None) -> OrgGroupMembership
    func GetOrgGroupMembership(ctx *Context, name string, id IDInput, state *OrgGroupMembershipState, opts ...ResourceOption) (*OrgGroupMembership, error)
    public static OrgGroupMembership Get(string name, Input<string> id, OrgGroupMembershipState? state, CustomResourceOptions? opts = null)
    public static OrgGroupMembership get(String name, Output<String> id, OrgGroupMembershipState state, CustomResourceOptions options)
    resources:  _:    type: datadog:OrgGroupMembership    get:      id: ${id}
    import {
      to = datadog_orggroupmembership.example
      id = "${id}"
    }
    
    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:
    OrgGroupId string
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    OrgName string
    The name of the organization.
    OrgSite string
    The site of the organization. Server-managed (derived from the organization's own settings).
    OrgUuid string
    The UUID of the organization. Must be a valid UUID.
    OrgGroupId string
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    OrgName string
    The name of the organization.
    OrgSite string
    The site of the organization. Server-managed (derived from the organization's own settings).
    OrgUuid string
    The UUID of the organization. Must be a valid UUID.
    org_group_id string
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    org_name string
    The name of the organization.
    org_site string
    The site of the organization. Server-managed (derived from the organization's own settings).
    org_uuid string
    The UUID of the organization. Must be a valid UUID.
    orgGroupId String
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    orgName String
    The name of the organization.
    orgSite String
    The site of the organization. Server-managed (derived from the organization's own settings).
    orgUuid String
    The UUID of the organization. Must be a valid UUID.
    orgGroupId string
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    orgName string
    The name of the organization.
    orgSite string
    The site of the organization. Server-managed (derived from the organization's own settings).
    orgUuid string
    The UUID of the organization. Must be a valid UUID.
    org_group_id str
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    org_name str
    The name of the organization.
    org_site str
    The site of the organization. Server-managed (derived from the organization's own settings).
    org_uuid str
    The UUID of the organization. Must be a valid UUID.
    orgGroupId String
    The UUID of the org group to assign the organization to. Must be a valid UUID.
    orgName String
    The name of the organization.
    orgSite String
    The site of the organization. Server-managed (derived from the organization's own settings).
    orgUuid String
    The UUID of the organization. Must be a valid UUID.

    Import

    $ pulumi import datadog:index/orgGroupMembership:OrgGroupMembership example <membership_uuid>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Viewing docs for Datadog v5.3.0
    published on Friday, May 22, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial