Datadog

v4.12.0 published on Friday, Oct 21, 2022 by Pulumi

AuthnMapping

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

Example Usage

using Pulumi;
using Datadog = Pulumi.Datadog;

class MyStack : Stack
{
    public MyStack()
    {
        var roRole = Output.Create(Datadog.GetRole.InvokeAsync(new Datadog.GetRoleArgs
        {
            Filter = "Datadog Read Only Role",
        }));
        // Create a new AuthN mapping
        var devRoRoleMapping = new Datadog.AuthnMapping("devRoRoleMapping", new Datadog.AuthnMappingArgs
        {
            Key = "Member-of",
            Value = "Development",
            Role = roRole.Apply(roRole => roRole.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, &GetRoleArgs{
			Filter: "Datadog Read Only Role",
		}, nil)
		if err != nil {
			return err
		}
		_, 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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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

    public static void stack(Context ctx) {
        final var roRole = Output.of(DatadogFunctions.getRole(GetRoleArgs.builder()
            .filter("Datadog Read Only Role")
            .build()));

        var devRoRoleMapping = new AuthnMapping("devRoRoleMapping", AuthnMappingArgs.builder()        
            .key("Member-of")
            .value("Development")
            .role(roRole.apply(getRoleResult -> getRoleResult.id()))
            .build());

    }
}
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)
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),
});
resources:
  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

new AuthnMapping(name: string, args: AuthnMappingArgs, opts?: CustomResourceOptions);
@overload
def AuthnMapping(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 key: Optional[str] = None,
                 role: Optional[str] = None,
                 value: Optional[str] = None)
@overload
def AuthnMapping(resource_name: str,
                 args: AuthnMappingArgs,
                 opts: Optional[ResourceOptions] = 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.

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.

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

Package Details

Repository
https://github.com/pulumi/pulumi-datadog
License
Apache-2.0
Notes

This Pulumi package is based on the datadog Terraform Provider.