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[_identity.AuthenticationPolicyNetworkPolicyArgs] = None,
password_policy: Optional[_identity.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:
- Compartment
Id string - The OCID of the compartment.
- Network
Policy AuthenticationPolicy Network Policy - (Updatable) Network policy, Consists of a list of Network Source ids.
- Password
Policy AuthenticationPolicy Password Policy - (Updatable) Password policy, currently set for the given compartment.
- Compartment
Id string - 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.
- compartment
Id String - The OCID of the compartment.
- network
Policy AuthenticationPolicy Network Policy - (Updatable) Network policy, Consists of a list of Network Source ids.
- password
Policy AuthenticationPolicy Password Policy - (Updatable) Password policy, currently set for the given compartment.
- compartment
Id string - The OCID of the compartment.
- network
Policy AuthenticationPolicy Network Policy - (Updatable) Network policy, Consists of a list of Network Source ids.
- password
Policy AuthenticationPolicy Password Policy - (Updatable) Password policy, currently set for the given compartment.
- compartment_
id str - The OCID of the compartment.
- network_
policy identity.Authentication Policy Network Policy Args - (Updatable) Network policy, Consists of a list of Network Source ids.
- password_
policy identity.Authentication Policy Password Policy Args - (Updatable) Password policy, currently set for the given compartment.
- compartment
Id String - The OCID of the compartment.
- network
Policy Property Map - (Updatable) Network policy, Consists of a list of Network Source ids.
- password
Policy 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.
- Compartment
Id string - The OCID of the compartment.
- Network
Policy AuthenticationPolicy Network Policy - (Updatable) Network policy, Consists of a list of Network Source ids.
- Password
Policy AuthenticationPolicy Password Policy - (Updatable) Password policy, currently set for the given compartment.
- Compartment
Id string - 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.
- compartment
Id String - The OCID of the compartment.
- network
Policy AuthenticationPolicy Network Policy - (Updatable) Network policy, Consists of a list of Network Source ids.
- password
Policy AuthenticationPolicy Password Policy - (Updatable) Password policy, currently set for the given compartment.
- compartment
Id string - The OCID of the compartment.
- network
Policy AuthenticationPolicy Network Policy - (Updatable) Network policy, Consists of a list of Network Source ids.
- password
Policy AuthenticationPolicy Password Policy - (Updatable) Password policy, currently set for the given compartment.
- compartment_
id str - The OCID of the compartment.
- network_
policy identity.Authentication Policy Network Policy Args - (Updatable) Network policy, Consists of a list of Network Source ids.
- password_
policy identity.Authentication Policy Password Policy Args - (Updatable) Password policy, currently set for the given compartment.
- compartment
Id String - The OCID of the compartment.
- network
Policy Property Map - (Updatable) Network policy, Consists of a list of Network Source ids.
- password
Policy Property Map - (Updatable) Password policy, currently set for the given compartment.
Supporting Types
AuthenticationPolicyNetworkPolicy, AuthenticationPolicyNetworkPolicyArgs
- Network
Source List<string>Ids - (Updatable) Network Source ids
- Network
Source []stringIds - (Updatable) Network Source ids
- network
Source List<String>Ids - (Updatable) Network Source ids
- network
Source string[]Ids - (Updatable) Network Source ids
- network_
source_ Sequence[str]ids - (Updatable) Network Source ids
- network
Source List<String>Ids - (Updatable) Network Source ids
AuthenticationPolicyPasswordPolicy, AuthenticationPolicyPasswordPolicyArgs
- 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
- 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
- is
Lowercase BooleanCharacters Required - (Updatable) At least one lower case character required.
- is
Numeric BooleanCharacters Required - (Updatable) At least one numeric character required.
- is
Special BooleanCharacters Required - (Updatable) At least one special character required.
- is
Uppercase BooleanCharacters Required - (Updatable) At least one uppercase character required.
- is
Username BooleanContainment Allowed - (Updatable) User name is allowed to be part of the password.
- minimum
Password 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
- is
Lowercase booleanCharacters Required - (Updatable) At least one lower case character required.
- is
Numeric booleanCharacters Required - (Updatable) At least one numeric character required.
- is
Special booleanCharacters Required - (Updatable) At least one special character required.
- is
Uppercase booleanCharacters Required - (Updatable) At least one uppercase character required.
- is
Username booleanContainment Allowed - (Updatable) User name is allowed to be part of the password.
- minimum
Password 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
- is
Lowercase BooleanCharacters Required - (Updatable) At least one lower case character required.
- is
Numeric BooleanCharacters Required - (Updatable) At least one numeric character required.
- is
Special BooleanCharacters Required - (Updatable) At least one special character required.
- is
Uppercase BooleanCharacters Required - (Updatable) At least one uppercase character required.
- is
Username BooleanContainment Allowed - (Updatable) User name is allowed to be part of the password.
- minimum
Password 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
oci
Terraform Provider.