1. Packages
  2. Cyral Provider
  3. API Docs
  4. getAccessTokenSettings
cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc

cyral.getAccessTokenSettings

Explore with Pulumi AI

cyral logo
cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc

    # cyral.AccessTokenSettings (Data Source)

    Retrieves the access token settings. See also the resource cyral.AccessTokenSettings.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cyral from "@pulumi/cyral";
    
    const tokenSettings = cyral.getAccessTokenSettings({});
    export const maxValidity = tokenSettings.then(tokenSettings => tokenSettings.maxValidity);
    export const defaultValidity = tokenSettings.then(tokenSettings => tokenSettings.defaultValidity);
    export const maxNumberOfTokensPerUser = tokenSettings.then(tokenSettings => tokenSettings.maxNumberOfTokensPerUser);
    export const offlineTokenValidation = tokenSettings.then(tokenSettings => tokenSettings.offlineTokenValidation);
    export const tokenLength = tokenSettings.then(tokenSettings => tokenSettings.tokenLength);
    
    import pulumi
    import pulumi_cyral as cyral
    
    token_settings = cyral.get_access_token_settings()
    pulumi.export("maxValidity", token_settings.max_validity)
    pulumi.export("defaultValidity", token_settings.default_validity)
    pulumi.export("maxNumberOfTokensPerUser", token_settings.max_number_of_tokens_per_user)
    pulumi.export("offlineTokenValidation", token_settings.offline_token_validation)
    pulumi.export("tokenLength", token_settings.token_length)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/cyral/v4/cyral"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tokenSettings, err := cyral.LookupAccessTokenSettings(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("maxValidity", tokenSettings.MaxValidity)
    		ctx.Export("defaultValidity", tokenSettings.DefaultValidity)
    		ctx.Export("maxNumberOfTokensPerUser", tokenSettings.MaxNumberOfTokensPerUser)
    		ctx.Export("offlineTokenValidation", tokenSettings.OfflineTokenValidation)
    		ctx.Export("tokenLength", tokenSettings.TokenLength)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cyral = Pulumi.Cyral;
    
    return await Deployment.RunAsync(() => 
    {
        var tokenSettings = Cyral.GetAccessTokenSettings.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["maxValidity"] = tokenSettings.Apply(getAccessTokenSettingsResult => getAccessTokenSettingsResult.MaxValidity),
            ["defaultValidity"] = tokenSettings.Apply(getAccessTokenSettingsResult => getAccessTokenSettingsResult.DefaultValidity),
            ["maxNumberOfTokensPerUser"] = tokenSettings.Apply(getAccessTokenSettingsResult => getAccessTokenSettingsResult.MaxNumberOfTokensPerUser),
            ["offlineTokenValidation"] = tokenSettings.Apply(getAccessTokenSettingsResult => getAccessTokenSettingsResult.OfflineTokenValidation),
            ["tokenLength"] = tokenSettings.Apply(getAccessTokenSettingsResult => getAccessTokenSettingsResult.TokenLength),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cyral.CyralFunctions;
    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) {
            final var tokenSettings = CyralFunctions.getAccessTokenSettings();
    
            ctx.export("maxValidity", tokenSettings.applyValue(getAccessTokenSettingsResult -> getAccessTokenSettingsResult.maxValidity()));
            ctx.export("defaultValidity", tokenSettings.applyValue(getAccessTokenSettingsResult -> getAccessTokenSettingsResult.defaultValidity()));
            ctx.export("maxNumberOfTokensPerUser", tokenSettings.applyValue(getAccessTokenSettingsResult -> getAccessTokenSettingsResult.maxNumberOfTokensPerUser()));
            ctx.export("offlineTokenValidation", tokenSettings.applyValue(getAccessTokenSettingsResult -> getAccessTokenSettingsResult.offlineTokenValidation()));
            ctx.export("tokenLength", tokenSettings.applyValue(getAccessTokenSettingsResult -> getAccessTokenSettingsResult.tokenLength()));
        }
    }
    
    variables:
      tokenSettings:
        fn::invoke:
          function: cyral:getAccessTokenSettings
          arguments: {}
    outputs:
      maxValidity: ${tokenSettings.maxValidity}
      defaultValidity: ${tokenSettings.defaultValidity}
      maxNumberOfTokensPerUser: ${tokenSettings.maxNumberOfTokensPerUser}
      offlineTokenValidation: ${tokenSettings.offlineTokenValidation}
      tokenLength: ${tokenSettings.tokenLength}
    

    Using getAccessTokenSettings

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAccessTokenSettings(opts?: InvokeOptions): Promise<GetAccessTokenSettingsResult>
    function getAccessTokenSettingsOutput(opts?: InvokeOptions): Output<GetAccessTokenSettingsResult>
    def get_access_token_settings(opts: Optional[InvokeOptions] = None) -> GetAccessTokenSettingsResult
    def get_access_token_settings_output(opts: Optional[InvokeOptions] = None) -> Output[GetAccessTokenSettingsResult]
    func LookupAccessTokenSettings(ctx *Context, opts ...InvokeOption) (*LookupAccessTokenSettingsResult, error)
    func LookupAccessTokenSettingsOutput(ctx *Context, opts ...InvokeOption) LookupAccessTokenSettingsResultOutput

    > Note: This function is named LookupAccessTokenSettings in the Go SDK.

    public static class GetAccessTokenSettings 
    {
        public static Task<GetAccessTokenSettingsResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetAccessTokenSettingsResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccessTokenSettingsResult> getAccessTokenSettings(InvokeOptions options)
    public static Output<GetAccessTokenSettingsResult> getAccessTokenSettings(InvokeOptions options)
    
    fn::invoke:
      function: cyral:index/getAccessTokenSettings:getAccessTokenSettings
      arguments:
        # arguments dictionary

    getAccessTokenSettings Result

    The following output properties are available:

    DefaultValidity string
    The default duration used for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    Id string
    The data source identifier. It's set as settings/access_token.
    MaxNumberOfTokensPerUser double
    The maximum number of access tokens that a user can have at the same time. Must be between 1 and 5 (inclusive). Defaults to 3.
    MaxValidity string
    The maximum duration that a user can request for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    OfflineTokenValidation bool
    The configuration that determines if the sidecar should perform access token validation independently using cached token values. If this is true, the sidecar will be able to validate and authenticate database access even when it cannot reach the Control Plane. Defaults to true.
    TokenLength double
    The number of characters of the access token plaintext value. Valid values are 8, 12 and 16. Defaults to 16.
    DefaultValidity string
    The default duration used for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    Id string
    The data source identifier. It's set as settings/access_token.
    MaxNumberOfTokensPerUser float64
    The maximum number of access tokens that a user can have at the same time. Must be between 1 and 5 (inclusive). Defaults to 3.
    MaxValidity string
    The maximum duration that a user can request for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    OfflineTokenValidation bool
    The configuration that determines if the sidecar should perform access token validation independently using cached token values. If this is true, the sidecar will be able to validate and authenticate database access even when it cannot reach the Control Plane. Defaults to true.
    TokenLength float64
    The number of characters of the access token plaintext value. Valid values are 8, 12 and 16. Defaults to 16.
    defaultValidity String
    The default duration used for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    id String
    The data source identifier. It's set as settings/access_token.
    maxNumberOfTokensPerUser Double
    The maximum number of access tokens that a user can have at the same time. Must be between 1 and 5 (inclusive). Defaults to 3.
    maxValidity String
    The maximum duration that a user can request for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    offlineTokenValidation Boolean
    The configuration that determines if the sidecar should perform access token validation independently using cached token values. If this is true, the sidecar will be able to validate and authenticate database access even when it cannot reach the Control Plane. Defaults to true.
    tokenLength Double
    The number of characters of the access token plaintext value. Valid values are 8, 12 and 16. Defaults to 16.
    defaultValidity string
    The default duration used for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    id string
    The data source identifier. It's set as settings/access_token.
    maxNumberOfTokensPerUser number
    The maximum number of access tokens that a user can have at the same time. Must be between 1 and 5 (inclusive). Defaults to 3.
    maxValidity string
    The maximum duration that a user can request for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    offlineTokenValidation boolean
    The configuration that determines if the sidecar should perform access token validation independently using cached token values. If this is true, the sidecar will be able to validate and authenticate database access even when it cannot reach the Control Plane. Defaults to true.
    tokenLength number
    The number of characters of the access token plaintext value. Valid values are 8, 12 and 16. Defaults to 16.
    default_validity str
    The default duration used for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    id str
    The data source identifier. It's set as settings/access_token.
    max_number_of_tokens_per_user float
    The maximum number of access tokens that a user can have at the same time. Must be between 1 and 5 (inclusive). Defaults to 3.
    max_validity str
    The maximum duration that a user can request for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    offline_token_validation bool
    The configuration that determines if the sidecar should perform access token validation independently using cached token values. If this is true, the sidecar will be able to validate and authenticate database access even when it cannot reach the Control Plane. Defaults to true.
    token_length float
    The number of characters of the access token plaintext value. Valid values are 8, 12 and 16. Defaults to 16.
    defaultValidity String
    The default duration used for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    id String
    The data source identifier. It's set as settings/access_token.
    maxNumberOfTokensPerUser Number
    The maximum number of access tokens that a user can have at the same time. Must be between 1 and 5 (inclusive). Defaults to 3.
    maxValidity String
    The maximum duration that a user can request for access token validity. Defaults to 36000s. Should follow the protobuf duration string format, which corresponds to a sequence of decimal numbers suffixed by a 's' at the end, representing the duration in seconds. For example: 300s, 60s, 10.50s, etc.
    offlineTokenValidation Boolean
    The configuration that determines if the sidecar should perform access token validation independently using cached token values. If this is true, the sidecar will be able to validate and authenticate database access even when it cannot reach the Control Plane. Defaults to true.
    tokenLength Number
    The number of characters of the access token plaintext value. Valid values are 8, 12 and 16. Defaults to 16.

    Package Details

    Repository
    cyral cyralinc/terraform-provider-cyral
    License
    Notes
    This Pulumi package is based on the cyral Terraform Provider.
    cyral logo
    cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc