oci.Identity.AuthenticationPolicy
Explore with Pulumi AI
This resource provides the Authentication Policy resource in Oracle Cloud Infrastructure Identity service.
Updates authentication policy for the specified tenancy
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testAuthenticationPolicy = new oci.identity.AuthenticationPolicy("test_authentication_policy", {
    compartmentId: tenancyOcid,
    networkPolicy: {
        networkSourceIds: authenticationPolicyNetworkPolicyNetworkSourceIds,
    },
    passwordPolicy: {
        isLowercaseCharactersRequired: authenticationPolicyPasswordPolicyIsLowercaseCharactersRequired,
        isNumericCharactersRequired: authenticationPolicyPasswordPolicyIsNumericCharactersRequired,
        isSpecialCharactersRequired: authenticationPolicyPasswordPolicyIsSpecialCharactersRequired,
        isUppercaseCharactersRequired: authenticationPolicyPasswordPolicyIsUppercaseCharactersRequired,
        isUsernameContainmentAllowed: authenticationPolicyPasswordPolicyIsUsernameContainmentAllowed,
        minimumPasswordLength: authenticationPolicyPasswordPolicyMinimumPasswordLength,
    },
});
import pulumi
import pulumi_oci as oci
test_authentication_policy = oci.identity.AuthenticationPolicy("test_authentication_policy",
    compartment_id=tenancy_ocid,
    network_policy={
        "network_source_ids": authentication_policy_network_policy_network_source_ids,
    },
    password_policy={
        "is_lowercase_characters_required": authentication_policy_password_policy_is_lowercase_characters_required,
        "is_numeric_characters_required": authentication_policy_password_policy_is_numeric_characters_required,
        "is_special_characters_required": authentication_policy_password_policy_is_special_characters_required,
        "is_uppercase_characters_required": authentication_policy_password_policy_is_uppercase_characters_required,
        "is_username_containment_allowed": authentication_policy_password_policy_is_username_containment_allowed,
        "minimum_password_length": authentication_policy_password_policy_minimum_password_length,
    })
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := identity.NewAuthenticationPolicy(ctx, "test_authentication_policy", &identity.AuthenticationPolicyArgs{
			CompartmentId: pulumi.Any(tenancyOcid),
			NetworkPolicy: &identity.AuthenticationPolicyNetworkPolicyArgs{
				NetworkSourceIds: pulumi.Any(authenticationPolicyNetworkPolicyNetworkSourceIds),
			},
			PasswordPolicy: &identity.AuthenticationPolicyPasswordPolicyArgs{
				IsLowercaseCharactersRequired: pulumi.Any(authenticationPolicyPasswordPolicyIsLowercaseCharactersRequired),
				IsNumericCharactersRequired:   pulumi.Any(authenticationPolicyPasswordPolicyIsNumericCharactersRequired),
				IsSpecialCharactersRequired:   pulumi.Any(authenticationPolicyPasswordPolicyIsSpecialCharactersRequired),
				IsUppercaseCharactersRequired: pulumi.Any(authenticationPolicyPasswordPolicyIsUppercaseCharactersRequired),
				IsUsernameContainmentAllowed:  pulumi.Any(authenticationPolicyPasswordPolicyIsUsernameContainmentAllowed),
				MinimumPasswordLength:         pulumi.Any(authenticationPolicyPasswordPolicyMinimumPasswordLength),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testAuthenticationPolicy = new Oci.Identity.AuthenticationPolicy("test_authentication_policy", new()
    {
        CompartmentId = tenancyOcid,
        NetworkPolicy = new Oci.Identity.Inputs.AuthenticationPolicyNetworkPolicyArgs
        {
            NetworkSourceIds = authenticationPolicyNetworkPolicyNetworkSourceIds,
        },
        PasswordPolicy = new Oci.Identity.Inputs.AuthenticationPolicyPasswordPolicyArgs
        {
            IsLowercaseCharactersRequired = authenticationPolicyPasswordPolicyIsLowercaseCharactersRequired,
            IsNumericCharactersRequired = authenticationPolicyPasswordPolicyIsNumericCharactersRequired,
            IsSpecialCharactersRequired = authenticationPolicyPasswordPolicyIsSpecialCharactersRequired,
            IsUppercaseCharactersRequired = authenticationPolicyPasswordPolicyIsUppercaseCharactersRequired,
            IsUsernameContainmentAllowed = authenticationPolicyPasswordPolicyIsUsernameContainmentAllowed,
            MinimumPasswordLength = authenticationPolicyPasswordPolicyMinimumPasswordLength,
        },
    });
});
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(tenancyOcid)
            .networkPolicy(AuthenticationPolicyNetworkPolicyArgs.builder()
                .networkSourceIds(authenticationPolicyNetworkPolicyNetworkSourceIds)
                .build())
            .passwordPolicy(AuthenticationPolicyPasswordPolicyArgs.builder()
                .isLowercaseCharactersRequired(authenticationPolicyPasswordPolicyIsLowercaseCharactersRequired)
                .isNumericCharactersRequired(authenticationPolicyPasswordPolicyIsNumericCharactersRequired)
                .isSpecialCharactersRequired(authenticationPolicyPasswordPolicyIsSpecialCharactersRequired)
                .isUppercaseCharactersRequired(authenticationPolicyPasswordPolicyIsUppercaseCharactersRequired)
                .isUsernameContainmentAllowed(authenticationPolicyPasswordPolicyIsUsernameContainmentAllowed)
                .minimumPasswordLength(authenticationPolicyPasswordPolicyMinimumPasswordLength)
                .build())
            .build());
    }
}
resources:
  testAuthenticationPolicy:
    type: oci:Identity:AuthenticationPolicy
    name: test_authentication_policy
    properties:
      compartmentId: ${tenancyOcid}
      networkPolicy:
        networkSourceIds: ${authenticationPolicyNetworkPolicyNetworkSourceIds}
      passwordPolicy:
        isLowercaseCharactersRequired: ${authenticationPolicyPasswordPolicyIsLowercaseCharactersRequired}
        isNumericCharactersRequired: ${authenticationPolicyPasswordPolicyIsNumericCharactersRequired}
        isSpecialCharactersRequired: ${authenticationPolicyPasswordPolicyIsSpecialCharactersRequired}
        isUppercaseCharactersRequired: ${authenticationPolicyPasswordPolicyIsUppercaseCharactersRequired}
        isUsernameContainmentAllowed: ${authenticationPolicyPasswordPolicyIsUsernameContainmentAllowed}
        minimumPasswordLength: ${authenticationPolicyPasswordPolicyMinimumPasswordLength}
Create AuthenticationPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AuthenticationPolicy(name: string, args: AuthenticationPolicyArgs, opts?: CustomResourceOptions);@overload
def AuthenticationPolicy(resource_name: str,
                         args: AuthenticationPolicyArgs,
                         opts: Optional[ResourceOptions] = None)
@overload
def AuthenticationPolicy(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         compartment_id: Optional[str] = None,
                         network_policy: Optional[AuthenticationPolicyNetworkPolicyArgs] = None,
                         password_policy: Optional[AuthenticationPolicyPasswordPolicyArgs] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var authenticationPolicyResource = new Oci.Identity.AuthenticationPolicy("authenticationPolicyResource", new()
{
    CompartmentId = "string",
    NetworkPolicy = new Oci.Identity.Inputs.AuthenticationPolicyNetworkPolicyArgs
    {
        NetworkSourceIds = new[]
        {
            "string",
        },
    },
    PasswordPolicy = new Oci.Identity.Inputs.AuthenticationPolicyPasswordPolicyArgs
    {
        IsLowercaseCharactersRequired = false,
        IsNumericCharactersRequired = false,
        IsSpecialCharactersRequired = false,
        IsUppercaseCharactersRequired = false,
        IsUsernameContainmentAllowed = false,
        MinimumPasswordLength = 0,
    },
});
example, err := identity.NewAuthenticationPolicy(ctx, "authenticationPolicyResource", &identity.AuthenticationPolicyArgs{
	CompartmentId: pulumi.String("string"),
	NetworkPolicy: &identity.AuthenticationPolicyNetworkPolicyArgs{
		NetworkSourceIds: pulumi.StringArray{
			pulumi.String("string"),
		},
	},
	PasswordPolicy: &identity.AuthenticationPolicyPasswordPolicyArgs{
		IsLowercaseCharactersRequired: pulumi.Bool(false),
		IsNumericCharactersRequired:   pulumi.Bool(false),
		IsSpecialCharactersRequired:   pulumi.Bool(false),
		IsUppercaseCharactersRequired: pulumi.Bool(false),
		IsUsernameContainmentAllowed:  pulumi.Bool(false),
		MinimumPasswordLength:         pulumi.Int(0),
	},
})
var authenticationPolicyResource = new AuthenticationPolicy("authenticationPolicyResource", AuthenticationPolicyArgs.builder()
    .compartmentId("string")
    .networkPolicy(AuthenticationPolicyNetworkPolicyArgs.builder()
        .networkSourceIds("string")
        .build())
    .passwordPolicy(AuthenticationPolicyPasswordPolicyArgs.builder()
        .isLowercaseCharactersRequired(false)
        .isNumericCharactersRequired(false)
        .isSpecialCharactersRequired(false)
        .isUppercaseCharactersRequired(false)
        .isUsernameContainmentAllowed(false)
        .minimumPasswordLength(0)
        .build())
    .build());
authentication_policy_resource = oci.identity.AuthenticationPolicy("authenticationPolicyResource",
    compartment_id="string",
    network_policy={
        "network_source_ids": ["string"],
    },
    password_policy={
        "is_lowercase_characters_required": False,
        "is_numeric_characters_required": False,
        "is_special_characters_required": False,
        "is_uppercase_characters_required": False,
        "is_username_containment_allowed": False,
        "minimum_password_length": 0,
    })
const authenticationPolicyResource = new oci.identity.AuthenticationPolicy("authenticationPolicyResource", {
    compartmentId: "string",
    networkPolicy: {
        networkSourceIds: ["string"],
    },
    passwordPolicy: {
        isLowercaseCharactersRequired: false,
        isNumericCharactersRequired: false,
        isSpecialCharactersRequired: false,
        isUppercaseCharactersRequired: false,
        isUsernameContainmentAllowed: false,
        minimumPasswordLength: 0,
    },
});
type: oci:Identity:AuthenticationPolicy
properties:
    compartmentId: string
    networkPolicy:
        networkSourceIds:
            - string
    passwordPolicy:
        isLowercaseCharactersRequired: false
        isNumericCharactersRequired: false
        isSpecialCharactersRequired: false
        isUppercaseCharactersRequired: false
        isUsernameContainmentAllowed: false
        minimumPasswordLength: 0
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AuthenticationPolicy resource accepts the following input properties:
- CompartmentId string
- The OCID of the compartment.
- NetworkPolicy AuthenticationPolicy Network Policy 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- PasswordPolicy AuthenticationPolicy Password Policy 
- (Updatable) Password policy, currently set for the given compartment.
- CompartmentId string
- The OCID of the compartment.
- NetworkPolicy AuthenticationPolicy Network Policy Args 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- PasswordPolicy AuthenticationPolicy Password Policy Args 
- (Updatable) Password policy, currently set for the given compartment.
- compartmentId String
- The OCID of the compartment.
- networkPolicy AuthenticationPolicy Network Policy 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- passwordPolicy AuthenticationPolicy Password Policy 
- (Updatable) Password policy, currently set for the given compartment.
- compartmentId string
- The OCID of the compartment.
- networkPolicy AuthenticationPolicy Network Policy 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- passwordPolicy AuthenticationPolicy Password Policy 
- (Updatable) Password policy, currently set for the given compartment.
- compartment_id str
- The OCID of the compartment.
- network_policy AuthenticationPolicy Network Policy Args 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- password_policy AuthenticationPolicy Password Policy Args 
- (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[AuthenticationPolicyNetworkPolicyArgs] = None,
        password_policy: Optional[AuthenticationPolicyPasswordPolicyArgs] = None) -> AuthenticationPolicyfunc 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)resources:  _:    type: oci:Identity:AuthenticationPolicy    get:      id: ${id}- 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.
- CompartmentId string
- The OCID of the compartment.
- NetworkPolicy AuthenticationPolicy Network Policy 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- PasswordPolicy AuthenticationPolicy Password Policy 
- (Updatable) Password policy, currently set for the given compartment.
- CompartmentId string
- The OCID of the compartment.
- NetworkPolicy AuthenticationPolicy Network Policy Args 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- PasswordPolicy AuthenticationPolicy Password Policy Args 
- (Updatable) Password policy, currently set for the given compartment.
- compartmentId String
- The OCID of the compartment.
- networkPolicy AuthenticationPolicy Network Policy 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- passwordPolicy AuthenticationPolicy Password Policy 
- (Updatable) Password policy, currently set for the given compartment.
- compartmentId string
- The OCID of the compartment.
- networkPolicy AuthenticationPolicy Network Policy 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- passwordPolicy AuthenticationPolicy Password Policy 
- (Updatable) Password policy, currently set for the given compartment.
- compartment_id str
- The OCID of the compartment.
- network_policy AuthenticationPolicy Network Policy Args 
- (Updatable) Network policy, Consists of a list of Network Source ids.
- password_policy AuthenticationPolicy Password Policy Args 
- (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, AuthenticationPolicyNetworkPolicyArgs        
- NetworkSource List<string>Ids 
- (Updatable) Network Source ids
- NetworkSource []stringIds 
- (Updatable) Network Source ids
- networkSource List<String>Ids 
- (Updatable) Network Source ids
- networkSource string[]Ids 
- (Updatable) Network Source ids
- network_source_ Sequence[str]ids 
- (Updatable) Network Source ids
- networkSource List<String>Ids 
- (Updatable) Network Source ids
AuthenticationPolicyPasswordPolicy, AuthenticationPolicyPasswordPolicyArgs        
- IsLowercase boolCharacters Required 
- (Updatable) At least one lower case character required.
- IsNumeric boolCharacters Required 
- (Updatable) At least one numeric character required.
- IsSpecial boolCharacters Required 
- (Updatable) At least one special character required.
- IsUppercase boolCharacters Required 
- (Updatable) At least one uppercase character required.
- IsUsername boolContainment Allowed 
- (Updatable) User name is allowed to be part of the password.
- MinimumPassword intLength 
- (Updatable) Minimum password length required. - ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values 
- IsLowercase boolCharacters Required 
- (Updatable) At least one lower case character required.
- IsNumeric boolCharacters Required 
- (Updatable) At least one numeric character required.
- IsSpecial boolCharacters Required 
- (Updatable) At least one special character required.
- IsUppercase boolCharacters Required 
- (Updatable) At least one uppercase character required.
- IsUsername boolContainment Allowed 
- (Updatable) User name is allowed to be part of the password.
- MinimumPassword intLength 
- (Updatable) Minimum password length required. - ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values 
- isLowercase BooleanCharacters Required 
- (Updatable) At least one lower case character required.
- isNumeric BooleanCharacters Required 
- (Updatable) At least one numeric character required.
- isSpecial BooleanCharacters Required 
- (Updatable) At least one special character required.
- isUppercase BooleanCharacters Required 
- (Updatable) At least one uppercase character required.
- isUsername BooleanContainment Allowed 
- (Updatable) User name is allowed to be part of the password.
- minimumPassword IntegerLength 
- (Updatable) Minimum password length required. - ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values 
- isLowercase booleanCharacters Required 
- (Updatable) At least one lower case character required.
- isNumeric booleanCharacters Required 
- (Updatable) At least one numeric character required.
- isSpecial booleanCharacters Required 
- (Updatable) At least one special character required.
- isUppercase booleanCharacters Required 
- (Updatable) At least one uppercase character required.
- isUsername booleanContainment Allowed 
- (Updatable) User name is allowed to be part of the password.
- minimumPassword numberLength 
- (Updatable) Minimum password length required. - ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values 
- is_lowercase_ boolcharacters_ required 
- (Updatable) At least one lower case character required.
- is_numeric_ boolcharacters_ required 
- (Updatable) At least one numeric character required.
- is_special_ boolcharacters_ required 
- (Updatable) At least one special character required.
- is_uppercase_ boolcharacters_ required 
- (Updatable) At least one uppercase character required.
- is_username_ boolcontainment_ allowed 
- (Updatable) User name is allowed to be part of the password.
- minimum_password_ intlength 
- (Updatable) Minimum password length required. - ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values 
- isLowercase BooleanCharacters Required 
- (Updatable) At least one lower case character required.
- isNumeric BooleanCharacters Required 
- (Updatable) At least one numeric character required.
- isSpecial BooleanCharacters Required 
- (Updatable) At least one special character required.
- isUppercase BooleanCharacters Required 
- (Updatable) At least one uppercase character required.
- isUsername BooleanContainment Allowed 
- (Updatable) User name is allowed to be part of the password.
- minimumPassword NumberLength 
- (Updatable) Minimum password length required. - ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values 
Import
AuthenticationPolicies can be imported using the id, e.g.
$ pulumi import oci:Identity/authenticationPolicy:AuthenticationPolicy test_authentication_policy "authenticationPolicies/{compartmentId}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.