Oracle Cloud Infrastructure

v0.5.0 published on Monday, Sep 12, 2022 by Pulumi

AuthenticationPolicy

This resource provides the Authentication Policy resource in Oracle Cloud Infrastructure Identity service.

Updates authentication policy for the specified tenancy

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testAuthenticationPolicy = new Oci.Identity.AuthenticationPolicy("testAuthenticationPolicy", new()
    {
        CompartmentId = @var.Tenancy_ocid,
        NetworkPolicy = new Oci.Identity.Inputs.AuthenticationPolicyNetworkPolicyArgs
        {
            NetworkSourceIds = @var.Authentication_policy_network_policy_network_source_ids,
        },
        PasswordPolicy = new Oci.Identity.Inputs.AuthenticationPolicyPasswordPolicyArgs
        {
            IsLowercaseCharactersRequired = @var.Authentication_policy_password_policy_is_lowercase_characters_required,
            IsNumericCharactersRequired = @var.Authentication_policy_password_policy_is_numeric_characters_required,
            IsSpecialCharactersRequired = @var.Authentication_policy_password_policy_is_special_characters_required,
            IsUppercaseCharactersRequired = @var.Authentication_policy_password_policy_is_uppercase_characters_required,
            IsUsernameContainmentAllowed = @var.Authentication_policy_password_policy_is_username_containment_allowed,
            MinimumPasswordLength = @var.Authentication_policy_password_policy_minimum_password_length,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/go/oci/Identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Identity.NewAuthenticationPolicy(ctx, "testAuthenticationPolicy", &Identity.AuthenticationPolicyArgs{
			CompartmentId: pulumi.Any(_var.Tenancy_ocid),
			NetworkPolicy: &identity.AuthenticationPolicyNetworkPolicyArgs{
				NetworkSourceIds: pulumi.Any(_var.Authentication_policy_network_policy_network_source_ids),
			},
			PasswordPolicy: &identity.AuthenticationPolicyPasswordPolicyArgs{
				IsLowercaseCharactersRequired: pulumi.Any(_var.Authentication_policy_password_policy_is_lowercase_characters_required),
				IsNumericCharactersRequired:   pulumi.Any(_var.Authentication_policy_password_policy_is_numeric_characters_required),
				IsSpecialCharactersRequired:   pulumi.Any(_var.Authentication_policy_password_policy_is_special_characters_required),
				IsUppercaseCharactersRequired: pulumi.Any(_var.Authentication_policy_password_policy_is_uppercase_characters_required),
				IsUsernameContainmentAllowed:  pulumi.Any(_var.Authentication_policy_password_policy_is_username_containment_allowed),
				MinimumPasswordLength:         pulumi.Any(_var.Authentication_policy_password_policy_minimum_password_length),
			},
		})
		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.oci.Identity.AuthenticationPolicy;
import com.pulumi.oci.Identity.AuthenticationPolicyArgs;
import com.pulumi.oci.Identity.inputs.AuthenticationPolicyNetworkPolicyArgs;
import com.pulumi.oci.Identity.inputs.AuthenticationPolicyPasswordPolicyArgs;
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 testAuthenticationPolicy = new AuthenticationPolicy("testAuthenticationPolicy", AuthenticationPolicyArgs.builder()        
            .compartmentId(var_.tenancy_ocid())
            .networkPolicy(AuthenticationPolicyNetworkPolicyArgs.builder()
                .networkSourceIds(var_.authentication_policy_network_policy_network_source_ids())
                .build())
            .passwordPolicy(AuthenticationPolicyPasswordPolicyArgs.builder()
                .isLowercaseCharactersRequired(var_.authentication_policy_password_policy_is_lowercase_characters_required())
                .isNumericCharactersRequired(var_.authentication_policy_password_policy_is_numeric_characters_required())
                .isSpecialCharactersRequired(var_.authentication_policy_password_policy_is_special_characters_required())
                .isUppercaseCharactersRequired(var_.authentication_policy_password_policy_is_uppercase_characters_required())
                .isUsernameContainmentAllowed(var_.authentication_policy_password_policy_is_username_containment_allowed())
                .minimumPasswordLength(var_.authentication_policy_password_policy_minimum_password_length())
                .build())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_authentication_policy = oci.identity.AuthenticationPolicy("testAuthenticationPolicy",
    compartment_id=var["tenancy_ocid"],
    network_policy=oci.identity.AuthenticationPolicyNetworkPolicyArgs(
        network_source_ids=var["authentication_policy_network_policy_network_source_ids"],
    ),
    password_policy=oci.identity.AuthenticationPolicyPasswordPolicyArgs(
        is_lowercase_characters_required=var["authentication_policy_password_policy_is_lowercase_characters_required"],
        is_numeric_characters_required=var["authentication_policy_password_policy_is_numeric_characters_required"],
        is_special_characters_required=var["authentication_policy_password_policy_is_special_characters_required"],
        is_uppercase_characters_required=var["authentication_policy_password_policy_is_uppercase_characters_required"],
        is_username_containment_allowed=var["authentication_policy_password_policy_is_username_containment_allowed"],
        minimum_password_length=var["authentication_policy_password_policy_minimum_password_length"],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testAuthenticationPolicy = new oci.identity.AuthenticationPolicy("testAuthenticationPolicy", {
    compartmentId: _var.tenancy_ocid,
    networkPolicy: {
        networkSourceIds: _var.authentication_policy_network_policy_network_source_ids,
    },
    passwordPolicy: {
        isLowercaseCharactersRequired: _var.authentication_policy_password_policy_is_lowercase_characters_required,
        isNumericCharactersRequired: _var.authentication_policy_password_policy_is_numeric_characters_required,
        isSpecialCharactersRequired: _var.authentication_policy_password_policy_is_special_characters_required,
        isUppercaseCharactersRequired: _var.authentication_policy_password_policy_is_uppercase_characters_required,
        isUsernameContainmentAllowed: _var.authentication_policy_password_policy_is_username_containment_allowed,
        minimumPasswordLength: _var.authentication_policy_password_policy_minimum_password_length,
    },
});
resources:
  testAuthenticationPolicy:
    type: oci:Identity:AuthenticationPolicy
    properties:
      #Required
      compartmentId: ${var.tenancy_ocid}
      networkPolicy:
        networkSourceIds: ${var.authentication_policy_network_policy_network_source_ids}
      passwordPolicy:
        isLowercaseCharactersRequired: ${var.authentication_policy_password_policy_is_lowercase_characters_required}
        isNumericCharactersRequired: ${var.authentication_policy_password_policy_is_numeric_characters_required}
        isSpecialCharactersRequired: ${var.authentication_policy_password_policy_is_special_characters_required}
        isUppercaseCharactersRequired: ${var.authentication_policy_password_policy_is_uppercase_characters_required}
        isUsernameContainmentAllowed: ${var.authentication_policy_password_policy_is_username_containment_allowed}
        minimumPasswordLength: ${var.authentication_policy_password_policy_minimum_password_length}

Create AuthenticationPolicy Resource

new AuthenticationPolicy(name: string, args: AuthenticationPolicyArgs, opts?: CustomResourceOptions);
@overload
def AuthenticationPolicy(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         compartment_id: Optional[str] = None,
                         network_policy: Optional[_identity.AuthenticationPolicyNetworkPolicyArgs] = None,
                         password_policy: Optional[_identity.AuthenticationPolicyPasswordPolicyArgs] = None)
@overload
def AuthenticationPolicy(resource_name: str,
                         args: AuthenticationPolicyArgs,
                         opts: Optional[ResourceOptions] = None)
func NewAuthenticationPolicy(ctx *Context, name string, args AuthenticationPolicyArgs, opts ...ResourceOption) (*AuthenticationPolicy, error)
public AuthenticationPolicy(string name, AuthenticationPolicyArgs args, CustomResourceOptions? opts = null)
public AuthenticationPolicy(String name, AuthenticationPolicyArgs args)
public AuthenticationPolicy(String name, AuthenticationPolicyArgs args, CustomResourceOptions options)
type: oci:Identity:AuthenticationPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

CompartmentId string

The OCID of the compartment.

NetworkPolicy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

PasswordPolicy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

CompartmentId string

The OCID of the compartment.

NetworkPolicy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

PasswordPolicy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

compartmentId String

The OCID of the compartment.

networkPolicy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

passwordPolicy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

compartmentId string

The OCID of the compartment.

networkPolicy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

passwordPolicy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

compartment_id str

The OCID of the compartment.

network_policy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

password_policy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

compartmentId String

The OCID of the compartment.

networkPolicy Property Map

(Updatable) Network policy, Consists of a list of Network Source ids.

passwordPolicy Property Map

(Updatable) Password policy, currently set for the given compartment.

Outputs

All input properties are implicitly available as output properties. Additionally, the AuthenticationPolicy 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 AuthenticationPolicy Resource

Get an existing AuthenticationPolicy 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?: AuthenticationPolicyState, opts?: CustomResourceOptions): AuthenticationPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        network_policy: Optional[_identity.AuthenticationPolicyNetworkPolicyArgs] = None,
        password_policy: Optional[_identity.AuthenticationPolicyPasswordPolicyArgs] = None) -> AuthenticationPolicy
func GetAuthenticationPolicy(ctx *Context, name string, id IDInput, state *AuthenticationPolicyState, opts ...ResourceOption) (*AuthenticationPolicy, error)
public static AuthenticationPolicy Get(string name, Input<string> id, AuthenticationPolicyState? state, CustomResourceOptions? opts = null)
public static AuthenticationPolicy get(String name, Output<String> id, AuthenticationPolicyState 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:
CompartmentId string

The OCID of the compartment.

NetworkPolicy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

PasswordPolicy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

CompartmentId string

The OCID of the compartment.

NetworkPolicy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

PasswordPolicy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

compartmentId String

The OCID of the compartment.

networkPolicy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

passwordPolicy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

compartmentId string

The OCID of the compartment.

networkPolicy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

passwordPolicy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

compartment_id str

The OCID of the compartment.

network_policy AuthenticationPolicyNetworkPolicyArgs

(Updatable) Network policy, Consists of a list of Network Source ids.

password_policy AuthenticationPolicyPasswordPolicyArgs

(Updatable) Password policy, currently set for the given compartment.

compartmentId String

The OCID of the compartment.

networkPolicy Property Map

(Updatable) Network policy, Consists of a list of Network Source ids.

passwordPolicy Property Map

(Updatable) Password policy, currently set for the given compartment.

Supporting Types

AuthenticationPolicyNetworkPolicy

NetworkSourceIds List<string>

(Updatable) Network Source ids

NetworkSourceIds []string

(Updatable) Network Source ids

networkSourceIds List<String>

(Updatable) Network Source ids

networkSourceIds string[]

(Updatable) Network Source ids

network_source_ids Sequence[str]

(Updatable) Network Source ids

networkSourceIds List<String>

(Updatable) Network Source ids

AuthenticationPolicyPasswordPolicy

IsLowercaseCharactersRequired bool

(Updatable) At least one lower case character required.

IsNumericCharactersRequired bool

(Updatable) At least one numeric character required.

IsSpecialCharactersRequired bool

(Updatable) At least one special character required.

IsUppercaseCharactersRequired bool

(Updatable) At least one uppercase character required.

IsUsernameContainmentAllowed bool

(Updatable) User name is allowed to be part of the password.

MinimumPasswordLength int

(Updatable) Minimum password length required.

IsLowercaseCharactersRequired bool

(Updatable) At least one lower case character required.

IsNumericCharactersRequired bool

(Updatable) At least one numeric character required.

IsSpecialCharactersRequired bool

(Updatable) At least one special character required.

IsUppercaseCharactersRequired bool

(Updatable) At least one uppercase character required.

IsUsernameContainmentAllowed bool

(Updatable) User name is allowed to be part of the password.

MinimumPasswordLength int

(Updatable) Minimum password length required.

isLowercaseCharactersRequired Boolean

(Updatable) At least one lower case character required.

isNumericCharactersRequired Boolean

(Updatable) At least one numeric character required.

isSpecialCharactersRequired Boolean

(Updatable) At least one special character required.

isUppercaseCharactersRequired Boolean

(Updatable) At least one uppercase character required.

isUsernameContainmentAllowed Boolean

(Updatable) User name is allowed to be part of the password.

minimumPasswordLength Integer

(Updatable) Minimum password length required.

isLowercaseCharactersRequired boolean

(Updatable) At least one lower case character required.

isNumericCharactersRequired boolean

(Updatable) At least one numeric character required.

isSpecialCharactersRequired boolean

(Updatable) At least one special character required.

isUppercaseCharactersRequired boolean

(Updatable) At least one uppercase character required.

isUsernameContainmentAllowed boolean

(Updatable) User name is allowed to be part of the password.

minimumPasswordLength number

(Updatable) Minimum password length required.

is_lowercase_characters_required bool

(Updatable) At least one lower case character required.

is_numeric_characters_required bool

(Updatable) At least one numeric character required.

is_special_characters_required bool

(Updatable) At least one special character required.

is_uppercase_characters_required bool

(Updatable) At least one uppercase character required.

is_username_containment_allowed bool

(Updatable) User name is allowed to be part of the password.

minimum_password_length int

(Updatable) Minimum password length required.

isLowercaseCharactersRequired Boolean

(Updatable) At least one lower case character required.

isNumericCharactersRequired Boolean

(Updatable) At least one numeric character required.

isSpecialCharactersRequired Boolean

(Updatable) At least one special character required.

isUppercaseCharactersRequired Boolean

(Updatable) At least one uppercase character required.

isUsernameContainmentAllowed Boolean

(Updatable) User name is allowed to be part of the password.

minimumPasswordLength Number

(Updatable) Minimum password length required.

Import

AuthenticationPolicies can be imported using the id, e.g.

 $ pulumi import oci:Identity/authenticationPolicy:AuthenticationPolicy test_authentication_policy "authenticationPolicies/{compartmentId}"

Package Details

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

This Pulumi package is based on the oci Terraform Provider.