1. Packages
  2. Outscale Provider
  3. API Docs
  4. ApiAccessPolicy
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

outscale.ApiAccessPolicy

Explore with Pulumi AI

Manages the API access policy.

To activate a trusted session, first you must:

  • Set expiration dates to all your access keys.
  • Specify a Certificate Authority (CA) in all your API access rules.

For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.

Example Usage

Require expiration dates for your access keys

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

const unique = new outscale.ApiAccessPolicy("unique", {
    maxAccessKeyExpirationSeconds: 31536000,
    requireTrustedEnv: false,
});
Copy
import pulumi
import pulumi_outscale as outscale

unique = outscale.ApiAccessPolicy("unique",
    max_access_key_expiration_seconds=31536000,
    require_trusted_env=False)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewApiAccessPolicy(ctx, "unique", &outscale.ApiAccessPolicyArgs{
			MaxAccessKeyExpirationSeconds: pulumi.Float64(31536000),
			RequireTrustedEnv:             pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var unique = new Outscale.ApiAccessPolicy("unique", new()
    {
        MaxAccessKeyExpirationSeconds = 31536000,
        RequireTrustedEnv = false,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.ApiAccessPolicy;
import com.pulumi.outscale.ApiAccessPolicyArgs;
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 unique = new ApiAccessPolicy("unique", ApiAccessPolicyArgs.builder()
            .maxAccessKeyExpirationSeconds(31536000)
            .requireTrustedEnv(false)
            .build());

    }
}
Copy
resources:
  unique:
    type: outscale:ApiAccessPolicy
    properties:
      maxAccessKeyExpirationSeconds: 3.1536e+07
      # 1 year
      requireTrustedEnv: false
Copy

Activate a trusted session

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

const unique = new outscale.ApiAccessPolicy("unique", {
    maxAccessKeyExpirationSeconds: 3153600000,
    requireTrustedEnv: true,
});
Copy
import pulumi
import pulumi_outscale as outscale

unique = outscale.ApiAccessPolicy("unique",
    max_access_key_expiration_seconds=3153600000,
    require_trusted_env=True)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewApiAccessPolicy(ctx, "unique", &outscale.ApiAccessPolicyArgs{
			MaxAccessKeyExpirationSeconds: pulumi.Float64(3153600000),
			RequireTrustedEnv:             pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var unique = new Outscale.ApiAccessPolicy("unique", new()
    {
        MaxAccessKeyExpirationSeconds = 3153600000,
        RequireTrustedEnv = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.ApiAccessPolicy;
import com.pulumi.outscale.ApiAccessPolicyArgs;
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 unique = new ApiAccessPolicy("unique", ApiAccessPolicyArgs.builder()
            .maxAccessKeyExpirationSeconds(3153600000)
            .requireTrustedEnv(true)
            .build());

    }
}
Copy
resources:
  unique:
    type: outscale:ApiAccessPolicy
    properties:
      maxAccessKeyExpirationSeconds: 3.1536e+09
      # 100 years
      requireTrustedEnv: true
Copy

Deactivate a trusted session

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

const unique = new outscale.ApiAccessPolicy("unique", {
    maxAccessKeyExpirationSeconds: 0,
    requireTrustedEnv: false,
});
Copy
import pulumi
import pulumi_outscale as outscale

unique = outscale.ApiAccessPolicy("unique",
    max_access_key_expiration_seconds=0,
    require_trusted_env=False)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewApiAccessPolicy(ctx, "unique", &outscale.ApiAccessPolicyArgs{
			MaxAccessKeyExpirationSeconds: pulumi.Float64(0),
			RequireTrustedEnv:             pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var unique = new Outscale.ApiAccessPolicy("unique", new()
    {
        MaxAccessKeyExpirationSeconds = 0,
        RequireTrustedEnv = false,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.ApiAccessPolicy;
import com.pulumi.outscale.ApiAccessPolicyArgs;
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 unique = new ApiAccessPolicy("unique", ApiAccessPolicyArgs.builder()
            .maxAccessKeyExpirationSeconds(0)
            .requireTrustedEnv(false)
            .build());

    }
}
Copy
resources:
  unique:
    type: outscale:ApiAccessPolicy
    properties:
      maxAccessKeyExpirationSeconds: 0
      requireTrustedEnv: false
Copy

Create ApiAccessPolicy Resource

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

Constructor syntax

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

@overload
def ApiAccessPolicy(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    max_access_key_expiration_seconds: Optional[float] = None,
                    require_trusted_env: Optional[bool] = None,
                    api_access_policy_id: Optional[str] = None)
func NewApiAccessPolicy(ctx *Context, name string, args ApiAccessPolicyArgs, opts ...ResourceOption) (*ApiAccessPolicy, error)
public ApiAccessPolicy(string name, ApiAccessPolicyArgs args, CustomResourceOptions? opts = null)
public ApiAccessPolicy(String name, ApiAccessPolicyArgs args)
public ApiAccessPolicy(String name, ApiAccessPolicyArgs args, CustomResourceOptions options)
type: outscale:ApiAccessPolicy
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. ApiAccessPolicyArgs
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. ApiAccessPolicyArgs
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. ApiAccessPolicyArgs
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. ApiAccessPolicyArgs
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. ApiAccessPolicyArgs
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 apiAccessPolicyResource = new Outscale.ApiAccessPolicy("apiAccessPolicyResource", new()
{
    MaxAccessKeyExpirationSeconds = 0,
    RequireTrustedEnv = false,
    ApiAccessPolicyId = "string",
});
Copy
example, err := outscale.NewApiAccessPolicy(ctx, "apiAccessPolicyResource", &outscale.ApiAccessPolicyArgs{
	MaxAccessKeyExpirationSeconds: pulumi.Float64(0),
	RequireTrustedEnv:             pulumi.Bool(false),
	ApiAccessPolicyId:             pulumi.String("string"),
})
Copy
var apiAccessPolicyResource = new ApiAccessPolicy("apiAccessPolicyResource", ApiAccessPolicyArgs.builder()
    .maxAccessKeyExpirationSeconds(0)
    .requireTrustedEnv(false)
    .apiAccessPolicyId("string")
    .build());
Copy
api_access_policy_resource = outscale.ApiAccessPolicy("apiAccessPolicyResource",
    max_access_key_expiration_seconds=0,
    require_trusted_env=False,
    api_access_policy_id="string")
Copy
const apiAccessPolicyResource = new outscale.ApiAccessPolicy("apiAccessPolicyResource", {
    maxAccessKeyExpirationSeconds: 0,
    requireTrustedEnv: false,
    apiAccessPolicyId: "string",
});
Copy
type: outscale:ApiAccessPolicy
properties:
    apiAccessPolicyId: string
    maxAccessKeyExpirationSeconds: 0
    requireTrustedEnv: false
Copy

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

MaxAccessKeyExpirationSeconds This property is required. double
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
RequireTrustedEnv This property is required. bool
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
ApiAccessPolicyId string
MaxAccessKeyExpirationSeconds This property is required. float64
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
RequireTrustedEnv This property is required. bool
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
ApiAccessPolicyId string
maxAccessKeyExpirationSeconds This property is required. Double
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
requireTrustedEnv This property is required. Boolean
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
apiAccessPolicyId String
maxAccessKeyExpirationSeconds This property is required. number
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
requireTrustedEnv This property is required. boolean
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
apiAccessPolicyId string
max_access_key_expiration_seconds This property is required. float
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
require_trusted_env This property is required. bool
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
api_access_policy_id str
maxAccessKeyExpirationSeconds This property is required. Number
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
requireTrustedEnv This property is required. Boolean
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
apiAccessPolicyId String

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
RequestId string
Id string
The provider-assigned unique ID for this managed resource.
RequestId string
id String
The provider-assigned unique ID for this managed resource.
requestId String
id string
The provider-assigned unique ID for this managed resource.
requestId string
id str
The provider-assigned unique ID for this managed resource.
request_id str
id String
The provider-assigned unique ID for this managed resource.
requestId String

Look up Existing ApiAccessPolicy Resource

Get an existing ApiAccessPolicy 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?: ApiAccessPolicyState, opts?: CustomResourceOptions): ApiAccessPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_access_policy_id: Optional[str] = None,
        max_access_key_expiration_seconds: Optional[float] = None,
        request_id: Optional[str] = None,
        require_trusted_env: Optional[bool] = None) -> ApiAccessPolicy
func GetApiAccessPolicy(ctx *Context, name string, id IDInput, state *ApiAccessPolicyState, opts ...ResourceOption) (*ApiAccessPolicy, error)
public static ApiAccessPolicy Get(string name, Input<string> id, ApiAccessPolicyState? state, CustomResourceOptions? opts = null)
public static ApiAccessPolicy get(String name, Output<String> id, ApiAccessPolicyState state, CustomResourceOptions options)
resources:  _:    type: outscale:ApiAccessPolicy    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:
ApiAccessPolicyId string
MaxAccessKeyExpirationSeconds double
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
RequestId string
RequireTrustedEnv bool
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
ApiAccessPolicyId string
MaxAccessKeyExpirationSeconds float64
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
RequestId string
RequireTrustedEnv bool
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
apiAccessPolicyId String
maxAccessKeyExpirationSeconds Double
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
requestId String
requireTrustedEnv Boolean
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
apiAccessPolicyId string
maxAccessKeyExpirationSeconds number
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
requestId string
requireTrustedEnv boolean
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
api_access_policy_id str
max_access_key_expiration_seconds float
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
request_id str
require_trusted_env bool
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.
apiAccessPolicyId String
maxAccessKeyExpirationSeconds Number
The maximum possible lifetime for your access keys, in seconds (between 0 and 3153600000, both included). If set to O, your access keys can have unlimited lifetimes, but a trusted session cannot be activated. Otherwise, all your access keys must have an expiration date. This value must be greater than the remaining lifetime of each access key of your account.
requestId String
requireTrustedEnv Boolean
If true, a trusted session is activated, provided that you specify the max_access_key_expiration_seconds parameter with a value greater than 0. Enabling this will require you and all your users to log in to Cockpit v2 using the WebAuthn method for multi-factor authentication. For more information, see About Authentication > Multi-Factor Authentication.

Package Details

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