datadog.AuthnMapping
Explore with Pulumi AI
Provides a Datadog AuthN Mappings resource. This feature lets you automatically assign roles to users based on their SAML attributes.
Example Usage
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 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
}
_, 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 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());
}
}
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:
# 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
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:
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.
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
- Datadog pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
datadog
Terraform Provider.