1. Packages
  2. Datadog
  3. API Docs
  4. AuthnMapping
Datadog v4.27.0 published on Thursday, Mar 14, 2024 by Pulumi

datadog.AuthnMapping

Explore with Pulumi AI

datadog logo
Datadog v4.27.0 published on Thursday, Mar 14, 2024 by Pulumi

    Provides a Datadog AuthN Mappings resource. This feature lets you automatically assign roles to users based on their SAML attributes.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const roRole = datadog.getRole({
        filter: "Datadog Read Only Role",
    });
    // Create a new AuthN mapping
    const devRoRoleMapping = new datadog.AuthnMapping("devRoRoleMapping", {
        key: "Member-of",
        value: "Development",
        role: roRole.then(roRole => roRole.id),
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    ro_role = datadog.get_role(filter="Datadog Read Only Role")
    # Create a new AuthN mapping
    dev_ro_role_mapping = datadog.AuthnMapping("devRoRoleMapping",
        key="Member-of",
        value="Development",
        role=ro_role.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		roRole, err := datadog.LookupRole(ctx, &datadog.LookupRoleArgs{
    			Filter: "Datadog Read Only Role",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Create a new AuthN mapping
    		_, err = datadog.NewAuthnMapping(ctx, "devRoRoleMapping", &datadog.AuthnMappingArgs{
    			Key:   pulumi.String("Member-of"),
    			Value: pulumi.String("Development"),
    			Role:  *pulumi.String(roRole.Id),
    		})
    		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 roRole = Datadog.GetRole.Invoke(new()
        {
            Filter = "Datadog Read Only Role",
        });
    
        // Create a new AuthN mapping
        var devRoRoleMapping = new Datadog.AuthnMapping("devRoRoleMapping", new()
        {
            Key = "Member-of",
            Value = "Development",
            Role = roRole.Apply(getRoleResult => getRoleResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.DatadogFunctions;
    import com.pulumi.datadog.inputs.GetRoleArgs;
    import com.pulumi.datadog.AuthnMapping;
    import com.pulumi.datadog.AuthnMappingArgs;
    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) {
            final var roRole = DatadogFunctions.getRole(GetRoleArgs.builder()
                .filter("Datadog Read Only Role")
                .build());
    
            var devRoRoleMapping = new AuthnMapping("devRoRoleMapping", AuthnMappingArgs.builder()        
                .key("Member-of")
                .value("Development")
                .role(roRole.applyValue(getRoleResult -> getRoleResult.id()))
                .build());
    
        }
    }
    
    resources:
      # Create a new AuthN mapping
      devRoRoleMapping:
        type: datadog:AuthnMapping
        properties:
          key: Member-of
          value: Development
          role: ${roRole.id}
    variables:
      roRole:
        fn::invoke:
          Function: datadog:getRole
          Arguments:
            filter: Datadog Read Only Role
    

    Create AuthnMapping Resource

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

    Constructor syntax

    new AuthnMapping(name: string, args: AuthnMappingArgs, opts?: CustomResourceOptions);
    @overload
    def AuthnMapping(resource_name: str,
                     args: AuthnMappingArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def AuthnMapping(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     key: Optional[str] = None,
                     role: Optional[str] = None,
                     value: Optional[str] = None)
    func NewAuthnMapping(ctx *Context, name string, args AuthnMappingArgs, opts ...ResourceOption) (*AuthnMapping, error)
    public AuthnMapping(string name, AuthnMappingArgs args, CustomResourceOptions? opts = null)
    public AuthnMapping(String name, AuthnMappingArgs args)
    public AuthnMapping(String name, AuthnMappingArgs args, CustomResourceOptions options)
    
    type: datadog:AuthnMapping
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

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

    Example

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

    var authnMappingResource = new Datadog.AuthnMapping("authnMappingResource", new()
    {
        Key = "string",
        Role = "string",
        Value = "string",
    });
    
    example, err := datadog.NewAuthnMapping(ctx, "authnMappingResource", &datadog.AuthnMappingArgs{
    	Key:   pulumi.String("string"),
    	Role:  pulumi.String("string"),
    	Value: pulumi.String("string"),
    })
    
    var authnMappingResource = new AuthnMapping("authnMappingResource", AuthnMappingArgs.builder()        
        .key("string")
        .role("string")
        .value("string")
        .build());
    
    authn_mapping_resource = datadog.AuthnMapping("authnMappingResource",
        key="string",
        role="string",
        value="string")
    
    const authnMappingResource = new datadog.AuthnMapping("authnMappingResource", {
        key: "string",
        role: "string",
        value: "string",
    });
    
    type: datadog:AuthnMapping
    properties:
        key: string
        role: string
        value: string
    

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

    Key string
    Identity provider key.
    Role string
    The ID of a role to attach to all users with the corresponding key and value.
    Value string
    Identity provider value.
    Key string
    Identity provider key.
    Role string
    The ID of a role to attach to all users with the corresponding key and value.
    Value string
    Identity provider value.
    key String
    Identity provider key.
    role String
    The ID of a role to attach to all users with the corresponding key and value.
    value String
    Identity provider value.
    key string
    Identity provider key.
    role string
    The ID of a role to attach to all users with the corresponding key and value.
    value string
    Identity provider value.
    key str
    Identity provider key.
    role str
    The ID of a role to attach to all users with the corresponding key and value.
    value str
    Identity provider value.
    key String
    Identity provider key.
    role String
    The ID of a role to attach to all users with the corresponding key and value.
    value String
    Identity provider value.

    Outputs

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

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

    Look up Existing AuthnMapping Resource

    Get an existing AuthnMapping 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?: AuthnMappingState, opts?: CustomResourceOptions): AuthnMapping
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            role: Optional[str] = None,
            value: Optional[str] = None) -> AuthnMapping
    func GetAuthnMapping(ctx *Context, name string, id IDInput, state *AuthnMappingState, opts ...ResourceOption) (*AuthnMapping, error)
    public static AuthnMapping Get(string name, Input<string> id, AuthnMappingState? state, CustomResourceOptions? opts = null)
    public static AuthnMapping get(String name, Output<String> id, AuthnMappingState 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:
    Key string
    Identity provider key.
    Role string
    The ID of a role to attach to all users with the corresponding key and value.
    Value string
    Identity provider value.
    Key string
    Identity provider key.
    Role string
    The ID of a role to attach to all users with the corresponding key and value.
    Value string
    Identity provider value.
    key String
    Identity provider key.
    role String
    The ID of a role to attach to all users with the corresponding key and value.
    value String
    Identity provider value.
    key string
    Identity provider key.
    role string
    The ID of a role to attach to all users with the corresponding key and value.
    value string
    Identity provider value.
    key str
    Identity provider key.
    role str
    The ID of a role to attach to all users with the corresponding key and value.
    value str
    Identity provider value.
    key String
    Identity provider key.
    role String
    The ID of a role to attach to all users with the corresponding key and value.
    value String
    Identity provider value.

    Import

    AuthN mappings can be imported using their ID, e.g.

    $ pulumi import datadog:index/authnMapping:AuthnMapping dev_ro_mapping 000000-0000-0000-0000-000000000000
    

    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
    Datadog v4.27.0 published on Thursday, Mar 14, 2024 by Pulumi