1. Packages
  2. Hsdp Provider
  3. API Docs
  4. IamMfaPolicy
hsdp 0.65.3 published on Tuesday, Apr 15, 2025 by philips-software

hsdp.IamMfaPolicy

Explore with Pulumi AI

Provides a resource for managing HSDP IAM MFA (Multi Factor Authentication) policies

Example Usage

The following example creates a MFA Policy for an organization

import * as pulumi from "@pulumi/pulumi";
import * as hsdp from "@pulumi/hsdp";

const mymfapolicy = new hsdp.IamMfaPolicy("mymfapolicy", {
    type: "SOFT_OTP",
    organization: _var.my_org.id,
    active: true,
});
Copy
import pulumi
import pulumi_hsdp as hsdp

mymfapolicy = hsdp.IamMfaPolicy("mymfapolicy",
    type="SOFT_OTP",
    organization=var["my_org"]["id"],
    active=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/hsdp/hsdp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := hsdp.NewIamMfaPolicy(ctx, "mymfapolicy", &hsdp.IamMfaPolicyArgs{
			Type:         pulumi.String("SOFT_OTP"),
			Organization: pulumi.Any(_var.My_org.Id),
			Active:       pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Hsdp = Pulumi.Hsdp;

return await Deployment.RunAsync(() => 
{
    var mymfapolicy = new Hsdp.IamMfaPolicy("mymfapolicy", new()
    {
        Type = "SOFT_OTP",
        Organization = @var.My_org.Id,
        Active = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hsdp.IamMfaPolicy;
import com.pulumi.hsdp.IamMfaPolicyArgs;
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 mymfapolicy = new IamMfaPolicy("mymfapolicy", IamMfaPolicyArgs.builder()
            .type("SOFT_OTP")
            .organization(var_.my_org().id())
            .active(true)
            .build());

    }
}
Copy
resources:
  mymfapolicy:
    type: hsdp:IamMfaPolicy
    properties:
      type: SOFT_OTP
      organization: ${var.my_org.id}
      active: true
Copy

And the example below creates a server OTP MFA Policy for an individual user

import * as pulumi from "@pulumi/pulumi";
import * as hsdp from "@pulumi/hsdp";

const joesPolicy = new hsdp.IamMfaPolicy("joesPolicy", {
    type: "SERVER_OTP",
    user: _var.user_joe.id,
    active: true,
});
Copy
import pulumi
import pulumi_hsdp as hsdp

joes_policy = hsdp.IamMfaPolicy("joesPolicy",
    type="SERVER_OTP",
    user=var["user_joe"]["id"],
    active=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/hsdp/hsdp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := hsdp.NewIamMfaPolicy(ctx, "joesPolicy", &hsdp.IamMfaPolicyArgs{
			Type:   pulumi.String("SERVER_OTP"),
			User:   pulumi.Any(_var.User_joe.Id),
			Active: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Hsdp = Pulumi.Hsdp;

return await Deployment.RunAsync(() => 
{
    var joesPolicy = new Hsdp.IamMfaPolicy("joesPolicy", new()
    {
        Type = "SERVER_OTP",
        User = @var.User_joe.Id,
        Active = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hsdp.IamMfaPolicy;
import com.pulumi.hsdp.IamMfaPolicyArgs;
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 joesPolicy = new IamMfaPolicy("joesPolicy", IamMfaPolicyArgs.builder()
            .type("SERVER_OTP")
            .user(var_.user_joe().id())
            .active(true)
            .build());

    }
}
Copy
resources:
  joesPolicy:
    type: hsdp:IamMfaPolicy
    properties:
      type: SERVER_OTP
      user: ${var.user_joe.id}
      active: true
Copy

Create IamMfaPolicy Resource

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

Constructor syntax

new IamMfaPolicy(name: string, args: IamMfaPolicyArgs, opts?: CustomResourceOptions);
@overload
def IamMfaPolicy(resource_name: str,
                 args: IamMfaPolicyArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def IamMfaPolicy(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 active: Optional[bool] = None,
                 type: Optional[str] = None,
                 description: Optional[str] = None,
                 iam_mfa_policy_id: Optional[str] = None,
                 name: Optional[str] = None,
                 organization: Optional[str] = None,
                 user: Optional[str] = None)
func NewIamMfaPolicy(ctx *Context, name string, args IamMfaPolicyArgs, opts ...ResourceOption) (*IamMfaPolicy, error)
public IamMfaPolicy(string name, IamMfaPolicyArgs args, CustomResourceOptions? opts = null)
public IamMfaPolicy(String name, IamMfaPolicyArgs args)
public IamMfaPolicy(String name, IamMfaPolicyArgs args, CustomResourceOptions options)
type: hsdp:IamMfaPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. IamMfaPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. IamMfaPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. IamMfaPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. IamMfaPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. IamMfaPolicyArgs
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 iamMfaPolicyResource = new Hsdp.IamMfaPolicy("iamMfaPolicyResource", new()
{
    Active = false,
    Type = "string",
    Description = "string",
    IamMfaPolicyId = "string",
    Name = "string",
    Organization = "string",
    User = "string",
});
Copy
example, err := hsdp.NewIamMfaPolicy(ctx, "iamMfaPolicyResource", &hsdp.IamMfaPolicyArgs{
Active: pulumi.Bool(false),
Type: pulumi.String("string"),
Description: pulumi.String("string"),
IamMfaPolicyId: pulumi.String("string"),
Name: pulumi.String("string"),
Organization: pulumi.String("string"),
User: pulumi.String("string"),
})
Copy
var iamMfaPolicyResource = new IamMfaPolicy("iamMfaPolicyResource", IamMfaPolicyArgs.builder()
    .active(false)
    .type("string")
    .description("string")
    .iamMfaPolicyId("string")
    .name("string")
    .organization("string")
    .user("string")
    .build());
Copy
iam_mfa_policy_resource = hsdp.IamMfaPolicy("iamMfaPolicyResource",
    active=False,
    type="string",
    description="string",
    iam_mfa_policy_id="string",
    name="string",
    organization="string",
    user="string")
Copy
const iamMfaPolicyResource = new hsdp.IamMfaPolicy("iamMfaPolicyResource", {
    active: false,
    type: "string",
    description: "string",
    iamMfaPolicyId: "string",
    name: "string",
    organization: "string",
    user: "string",
});
Copy
type: hsdp:IamMfaPolicy
properties:
    active: false
    description: string
    iamMfaPolicyId: string
    name: string
    organization: string
    type: string
    user: string
Copy

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

Active This property is required. bool
Defaults to true. Setting to false will disable MFA for the subject.
Type This property is required. string
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
Description string
The description of the policy
IamMfaPolicyId string
The GUID of the MFA policy
Name string
The name of the policy
Organization string
The organization to attach this policy to. Conflicts with user
User string
The user UUID to attach this policy to. Conflicts with organization
Active This property is required. bool
Defaults to true. Setting to false will disable MFA for the subject.
Type This property is required. string
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
Description string
The description of the policy
IamMfaPolicyId string
The GUID of the MFA policy
Name string
The name of the policy
Organization string
The organization to attach this policy to. Conflicts with user
User string
The user UUID to attach this policy to. Conflicts with organization
active This property is required. Boolean
Defaults to true. Setting to false will disable MFA for the subject.
type This property is required. String
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
description String
The description of the policy
iamMfaPolicyId String
The GUID of the MFA policy
name String
The name of the policy
organization String
The organization to attach this policy to. Conflicts with user
user String
The user UUID to attach this policy to. Conflicts with organization
active This property is required. boolean
Defaults to true. Setting to false will disable MFA for the subject.
type This property is required. string
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
description string
The description of the policy
iamMfaPolicyId string
The GUID of the MFA policy
name string
The name of the policy
organization string
The organization to attach this policy to. Conflicts with user
user string
The user UUID to attach this policy to. Conflicts with organization
active This property is required. bool
Defaults to true. Setting to false will disable MFA for the subject.
type This property is required. str
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
description str
The description of the policy
iam_mfa_policy_id str
The GUID of the MFA policy
name str
The name of the policy
organization str
The organization to attach this policy to. Conflicts with user
user str
The user UUID to attach this policy to. Conflicts with organization
active This property is required. Boolean
Defaults to true. Setting to false will disable MFA for the subject.
type This property is required. String
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
description String
The description of the policy
iamMfaPolicyId String
The GUID of the MFA policy
name String
The name of the policy
organization String
The organization to attach this policy to. Conflicts with user
user String
The user UUID to attach this policy to. Conflicts with organization

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Version string
The version of the MFA policy
Id string
The provider-assigned unique ID for this managed resource.
Version string
The version of the MFA policy
id String
The provider-assigned unique ID for this managed resource.
version String
The version of the MFA policy
id string
The provider-assigned unique ID for this managed resource.
version string
The version of the MFA policy
id str
The provider-assigned unique ID for this managed resource.
version str
The version of the MFA policy
id String
The provider-assigned unique ID for this managed resource.
version String
The version of the MFA policy

Look up Existing IamMfaPolicy Resource

Get an existing IamMfaPolicy 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?: IamMfaPolicyState, opts?: CustomResourceOptions): IamMfaPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        active: Optional[bool] = None,
        description: Optional[str] = None,
        iam_mfa_policy_id: Optional[str] = None,
        name: Optional[str] = None,
        organization: Optional[str] = None,
        type: Optional[str] = None,
        user: Optional[str] = None,
        version: Optional[str] = None) -> IamMfaPolicy
func GetIamMfaPolicy(ctx *Context, name string, id IDInput, state *IamMfaPolicyState, opts ...ResourceOption) (*IamMfaPolicy, error)
public static IamMfaPolicy Get(string name, Input<string> id, IamMfaPolicyState? state, CustomResourceOptions? opts = null)
public static IamMfaPolicy get(String name, Output<String> id, IamMfaPolicyState state, CustomResourceOptions options)
resources:  _:    type: hsdp:IamMfaPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Active bool
Defaults to true. Setting to false will disable MFA for the subject.
Description string
The description of the policy
IamMfaPolicyId string
The GUID of the MFA policy
Name string
The name of the policy
Organization string
The organization to attach this policy to. Conflicts with user
Type string
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
User string
The user UUID to attach this policy to. Conflicts with organization
Version string
The version of the MFA policy
Active bool
Defaults to true. Setting to false will disable MFA for the subject.
Description string
The description of the policy
IamMfaPolicyId string
The GUID of the MFA policy
Name string
The name of the policy
Organization string
The organization to attach this policy to. Conflicts with user
Type string
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
User string
The user UUID to attach this policy to. Conflicts with organization
Version string
The version of the MFA policy
active Boolean
Defaults to true. Setting to false will disable MFA for the subject.
description String
The description of the policy
iamMfaPolicyId String
The GUID of the MFA policy
name String
The name of the policy
organization String
The organization to attach this policy to. Conflicts with user
type String
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
user String
The user UUID to attach this policy to. Conflicts with organization
version String
The version of the MFA policy
active boolean
Defaults to true. Setting to false will disable MFA for the subject.
description string
The description of the policy
iamMfaPolicyId string
The GUID of the MFA policy
name string
The name of the policy
organization string
The organization to attach this policy to. Conflicts with user
type string
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
user string
The user UUID to attach this policy to. Conflicts with organization
version string
The version of the MFA policy
active bool
Defaults to true. Setting to false will disable MFA for the subject.
description str
The description of the policy
iam_mfa_policy_id str
The GUID of the MFA policy
name str
The name of the policy
organization str
The organization to attach this policy to. Conflicts with user
type str
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
user str
The user UUID to attach this policy to. Conflicts with organization
version str
The version of the MFA policy
active Boolean
Defaults to true. Setting to false will disable MFA for the subject.
description String
The description of the policy
iamMfaPolicyId String
The GUID of the MFA policy
name String
The name of the policy
organization String
The organization to attach this policy to. Conflicts with user
type String
the OTP type. Valid values: [SOFT_OTP | SERVER_OTP | SERVER_OTP_EMAIL | SERVER_OTP_SMS | SERVER_OTP_ANY ]
user String
The user UUID to attach this policy to. Conflicts with organization
version String
The version of the MFA policy

Import

$ pulumi import hsdp:index/iamMfaPolicy:IamMfaPolicy An existing MFA policy can be imported using `hsdp_iam_mfa_policy`, e.g.
Copy
$ pulumi import hsdp:index/iamMfaPolicy:IamMfaPolicy mymfapolicy a-guid
Copy

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

Package Details

Repository
hsdp philips-software/terraform-provider-hsdp
License
Notes
This Pulumi package is based on the hsdp Terraform Provider.