Viewing docs for Terraform v6.1.0
published on Monday, Jul 20, 2026 by Pulumi
published on Monday, Jul 20, 2026 by Pulumi
Viewing docs for Terraform v6.1.0
published on Monday, Jul 20, 2026 by Pulumi
published on Monday, Jul 20, 2026 by Pulumi
Access state from an AWS S3 bucket.
Using getS3Reference
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 getS3Reference(args: GetS3ReferenceArgs, opts?: InvokeOptions): Promise<GetS3ReferenceResult>
function getS3ReferenceOutput(args: GetS3ReferenceOutputArgs, opts?: InvokeOptions): Output<GetS3ReferenceResult>def get_s3_reference(access_key: Optional[str] = None,
assume_role_duration_seconds: Optional[int] = None,
assume_role_policy: Optional[str] = None,
assume_role_policy_arns: Optional[Sequence[str]] = None,
assume_role_tags: Optional[Mapping[str, str]] = None,
assume_role_transitive_tag_keys: Optional[Sequence[str]] = None,
bucket: Optional[str] = None,
encrypt: Optional[bool] = None,
endpoint: Optional[str] = None,
external_id: Optional[str] = None,
force_path_style: Optional[bool] = None,
iam_endpoint: Optional[str] = None,
key: Optional[str] = None,
kms_key_id: Optional[str] = None,
max_retries: Optional[int] = None,
profile: Optional[str] = None,
region: Optional[str] = None,
role_arn: Optional[str] = None,
secret_key: Optional[str] = None,
session_name: Optional[str] = None,
shared_credentials_file: Optional[str] = None,
skip_credentials_validation: Optional[bool] = None,
skip_metadata_api_check: Optional[bool] = None,
skip_region_validation: Optional[bool] = None,
sse_customer_key: Optional[str] = None,
sts_endpoint: Optional[str] = None,
token: Optional[str] = None,
workspace: Optional[str] = None,
workspace_key_prefix: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetS3ReferenceResult
def get_s3_reference_output(access_key: pulumi.Input[Optional[str]] = None,
assume_role_duration_seconds: pulumi.Input[Optional[int]] = None,
assume_role_policy: pulumi.Input[Optional[str]] = None,
assume_role_policy_arns: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
assume_role_tags: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
assume_role_transitive_tag_keys: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
bucket: pulumi.Input[Optional[str]] = None,
encrypt: pulumi.Input[Optional[bool]] = None,
endpoint: pulumi.Input[Optional[str]] = None,
external_id: pulumi.Input[Optional[str]] = None,
force_path_style: pulumi.Input[Optional[bool]] = None,
iam_endpoint: pulumi.Input[Optional[str]] = None,
key: pulumi.Input[Optional[str]] = None,
kms_key_id: pulumi.Input[Optional[str]] = None,
max_retries: pulumi.Input[Optional[int]] = None,
profile: pulumi.Input[Optional[str]] = None,
region: pulumi.Input[Optional[str]] = None,
role_arn: pulumi.Input[Optional[str]] = None,
secret_key: pulumi.Input[Optional[str]] = None,
session_name: pulumi.Input[Optional[str]] = None,
shared_credentials_file: pulumi.Input[Optional[str]] = None,
skip_credentials_validation: pulumi.Input[Optional[bool]] = None,
skip_metadata_api_check: pulumi.Input[Optional[bool]] = None,
skip_region_validation: pulumi.Input[Optional[bool]] = None,
sse_customer_key: pulumi.Input[Optional[str]] = None,
sts_endpoint: pulumi.Input[Optional[str]] = None,
token: pulumi.Input[Optional[str]] = None,
workspace: pulumi.Input[Optional[str]] = None,
workspace_key_prefix: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetS3ReferenceResult]func GetS3Reference(ctx *Context, args *GetS3ReferenceArgs, opts ...InvokeOption) (*GetS3ReferenceResult, error)
func GetS3ReferenceOutput(ctx *Context, args *GetS3ReferenceOutputArgs, opts ...InvokeOption) GetS3ReferenceResultOutput> Note: This function is named GetS3Reference in the Go SDK.
public static class GetS3Reference
{
public static Task<GetS3ReferenceResult> InvokeAsync(GetS3ReferenceArgs args, InvokeOptions? opts = null)
public static Output<GetS3ReferenceResult> Invoke(GetS3ReferenceInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetS3ReferenceResult> getS3Reference(GetS3ReferenceArgs args, InvokeOptions options)
public static Output<GetS3ReferenceResult> getS3Reference(GetS3ReferenceArgs args, InvokeOptions options)
fn::invoke:
function: terraform:state:getS3Reference
arguments:
# arguments dictionarydata "terraform_state_get_s3_reference" "name" {
# arguments
}The following arguments are supported:
- Bucket string
- The name of the S3 bucket.
- Key string
- The path to the state file inside the bucket. When using a non-default workspace, the state path is /workspace_key_prefix/workspace_name/key.
- Access
Key string - AWS access key.
- Assume
Role intDuration Seconds - The duration, in seconds, of the assume role session.
- Assume
Role stringPolicy - IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.
- Assume
Role List<string>Policy Arns - Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.
- Dictionary<string, string>
- Assume role session tags.
- Assume
Role List<string>Transitive Tag Keys - Assume role session tag keys to pass to any subsequent sessions.
- Encrypt bool
- Whether to enable server side encryption of the state file.
- Endpoint string
- A custom endpoint for the S3 API.
- External
Id string - The external ID to use when assuming the role.
- Force
Path boolStyle - Force s3 to use path-style addressing instead of virtual hosted-bucket addressing. Required by most S3-compatible stores.
- Iam
Endpoint string - A custom endpoint for the IAM API.
- Kms
Key stringId - The ARN of a KMS Key to use for encrypting the state.
- Max
Retries int - The maximum number of times an AWS API request is retried on retryable failure.
- Profile string
- AWS profile name as set in the shared credentials file.
- Region string
- AWS region of the S3 bucket. Falls back to the AWS_REGION or AWS_DEFAULT_REGION environment variables when unset.
- Role
Arn string - The ARN of an IAM Role to be assumed in order to read the state.
- Secret
Key string - AWS secret key.
- Session
Name string - The session name to use when assuming the role.
- string
- Path to a shared credentials file.
- Skip
Credentials boolValidation - Skip the credentials validation via the STS API.
- Skip
Metadata boolApi Check - Skip the AWS Metadata API check.
- Skip
Region boolValidation - Skip static validation of region name.
- Sse
Customer stringKey - The base64-encoded encryption key to use for server-side encryption with customer-provided keys (SSE-C).
- Sts
Endpoint string - A custom endpoint for the STS API.
- Token string
- AWS session token.
- Workspace string
- The Terraform workspace to read state from.
- Workspace
Key stringPrefix - The prefix applied to the non-default state path inside the bucket.
- Bucket string
- The name of the S3 bucket.
- Key string
- The path to the state file inside the bucket. When using a non-default workspace, the state path is /workspace_key_prefix/workspace_name/key.
- Access
Key string - AWS access key.
- Assume
Role intDuration Seconds - The duration, in seconds, of the assume role session.
- Assume
Role stringPolicy - IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.
- Assume
Role []stringPolicy Arns - Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.
- map[string]string
- Assume role session tags.
- Assume
Role []stringTransitive Tag Keys - Assume role session tag keys to pass to any subsequent sessions.
- Encrypt bool
- Whether to enable server side encryption of the state file.
- Endpoint string
- A custom endpoint for the S3 API.
- External
Id string - The external ID to use when assuming the role.
- Force
Path boolStyle - Force s3 to use path-style addressing instead of virtual hosted-bucket addressing. Required by most S3-compatible stores.
- Iam
Endpoint string - A custom endpoint for the IAM API.
- Kms
Key stringId - The ARN of a KMS Key to use for encrypting the state.
- Max
Retries int - The maximum number of times an AWS API request is retried on retryable failure.
- Profile string
- AWS profile name as set in the shared credentials file.
- Region string
- AWS region of the S3 bucket. Falls back to the AWS_REGION or AWS_DEFAULT_REGION environment variables when unset.
- Role
Arn string - The ARN of an IAM Role to be assumed in order to read the state.
- Secret
Key string - AWS secret key.
- Session
Name string - The session name to use when assuming the role.
- string
- Path to a shared credentials file.
- Skip
Credentials boolValidation - Skip the credentials validation via the STS API.
- Skip
Metadata boolApi Check - Skip the AWS Metadata API check.
- Skip
Region boolValidation - Skip static validation of region name.
- Sse
Customer stringKey - The base64-encoded encryption key to use for server-side encryption with customer-provided keys (SSE-C).
- Sts
Endpoint string - A custom endpoint for the STS API.
- Token string
- AWS session token.
- Workspace string
- The Terraform workspace to read state from.
- Workspace
Key stringPrefix - The prefix applied to the non-default state path inside the bucket.
- bucket string
- The name of the S3 bucket.
- key string
- The path to the state file inside the bucket. When using a non-default workspace, the state path is /workspace_key_prefix/workspace_name/key.
- access_
key string - AWS access key.
- assume_
role_ numberduration_ seconds - The duration, in seconds, of the assume role session.
- assume_
role_ stringpolicy - IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.
- assume_
role_ list(string)policy_ arns - Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.
- map(string)
- Assume role session tags.
- assume_
role_ list(string)transitive_ tag_ keys - Assume role session tag keys to pass to any subsequent sessions.
- encrypt bool
- Whether to enable server side encryption of the state file.
- endpoint string
- A custom endpoint for the S3 API.
- external_
id string - The external ID to use when assuming the role.
- force_
path_ boolstyle - Force s3 to use path-style addressing instead of virtual hosted-bucket addressing. Required by most S3-compatible stores.
- iam_
endpoint string - A custom endpoint for the IAM API.
- kms_
key_ stringid - The ARN of a KMS Key to use for encrypting the state.
- max_
retries number - The maximum number of times an AWS API request is retried on retryable failure.
- profile string
- AWS profile name as set in the shared credentials file.
- region string
- AWS region of the S3 bucket. Falls back to the AWS_REGION or AWS_DEFAULT_REGION environment variables when unset.
- role_
arn string - The ARN of an IAM Role to be assumed in order to read the state.
- secret_
key string - AWS secret key.
- session_
name string - The session name to use when assuming the role.
- string
- Path to a shared credentials file.
- skip_
credentials_ boolvalidation - Skip the credentials validation via the STS API.
- skip_
metadata_ boolapi_ check - Skip the AWS Metadata API check.
- skip_
region_ boolvalidation - Skip static validation of region name.
- sse_
customer_ stringkey - The base64-encoded encryption key to use for server-side encryption with customer-provided keys (SSE-C).
- sts_
endpoint string - A custom endpoint for the STS API.
- token string
- AWS session token.
- workspace string
- The Terraform workspace to read state from.
- workspace_
key_ stringprefix - The prefix applied to the non-default state path inside the bucket.
- bucket String
- The name of the S3 bucket.
- key String
- The path to the state file inside the bucket. When using a non-default workspace, the state path is /workspace_key_prefix/workspace_name/key.
- access
Key String - AWS access key.
- assume
Role IntegerDuration Seconds - The duration, in seconds, of the assume role session.
- assume
Role StringPolicy - IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.
- assume
Role List<String>Policy Arns - Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.
- Map<String,String>
- Assume role session tags.
- assume
Role List<String>Transitive Tag Keys - Assume role session tag keys to pass to any subsequent sessions.
- encrypt Boolean
- Whether to enable server side encryption of the state file.
- endpoint String
- A custom endpoint for the S3 API.
- external
Id String - The external ID to use when assuming the role.
- force
Path BooleanStyle - Force s3 to use path-style addressing instead of virtual hosted-bucket addressing. Required by most S3-compatible stores.
- iam
Endpoint String - A custom endpoint for the IAM API.
- kms
Key StringId - The ARN of a KMS Key to use for encrypting the state.
- max
Retries Integer - The maximum number of times an AWS API request is retried on retryable failure.
- profile String
- AWS profile name as set in the shared credentials file.
- region String
- AWS region of the S3 bucket. Falls back to the AWS_REGION or AWS_DEFAULT_REGION environment variables when unset.
- role
Arn String - The ARN of an IAM Role to be assumed in order to read the state.
- secret
Key String - AWS secret key.
- session
Name String - The session name to use when assuming the role.
- String
- Path to a shared credentials file.
- skip
Credentials BooleanValidation - Skip the credentials validation via the STS API.
- skip
Metadata BooleanApi Check - Skip the AWS Metadata API check.
- skip
Region BooleanValidation - Skip static validation of region name.
- sse
Customer StringKey - The base64-encoded encryption key to use for server-side encryption with customer-provided keys (SSE-C).
- sts
Endpoint String - A custom endpoint for the STS API.
- token String
- AWS session token.
- workspace String
- The Terraform workspace to read state from.
- workspace
Key StringPrefix - The prefix applied to the non-default state path inside the bucket.
- bucket string
- The name of the S3 bucket.
- key string
- The path to the state file inside the bucket. When using a non-default workspace, the state path is /workspace_key_prefix/workspace_name/key.
- access
Key string - AWS access key.
- assume
Role numberDuration Seconds - The duration, in seconds, of the assume role session.
- assume
Role stringPolicy - IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.
- assume
Role string[]Policy Arns - Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.
- {[key: string]: string}
- Assume role session tags.
- assume
Role string[]Transitive Tag Keys - Assume role session tag keys to pass to any subsequent sessions.
- encrypt boolean
- Whether to enable server side encryption of the state file.
- endpoint string
- A custom endpoint for the S3 API.
- external
Id string - The external ID to use when assuming the role.
- force
Path booleanStyle - Force s3 to use path-style addressing instead of virtual hosted-bucket addressing. Required by most S3-compatible stores.
- iam
Endpoint string - A custom endpoint for the IAM API.
- kms
Key stringId - The ARN of a KMS Key to use for encrypting the state.
- max
Retries number - The maximum number of times an AWS API request is retried on retryable failure.
- profile string
- AWS profile name as set in the shared credentials file.
- region string
- AWS region of the S3 bucket. Falls back to the AWS_REGION or AWS_DEFAULT_REGION environment variables when unset.
- role
Arn string - The ARN of an IAM Role to be assumed in order to read the state.
- secret
Key string - AWS secret key.
- session
Name string - The session name to use when assuming the role.
- string
- Path to a shared credentials file.
- skip
Credentials booleanValidation - Skip the credentials validation via the STS API.
- skip
Metadata booleanApi Check - Skip the AWS Metadata API check.
- skip
Region booleanValidation - Skip static validation of region name.
- sse
Customer stringKey - The base64-encoded encryption key to use for server-side encryption with customer-provided keys (SSE-C).
- sts
Endpoint string - A custom endpoint for the STS API.
- token string
- AWS session token.
- workspace string
- The Terraform workspace to read state from.
- workspace
Key stringPrefix - The prefix applied to the non-default state path inside the bucket.
- bucket str
- The name of the S3 bucket.
- key str
- The path to the state file inside the bucket. When using a non-default workspace, the state path is /workspace_key_prefix/workspace_name/key.
- access_
key str - AWS access key.
- assume_
role_ intduration_ seconds - The duration, in seconds, of the assume role session.
- assume_
role_ strpolicy - IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.
- assume_
role_ Sequence[str]policy_ arns - Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.
- Mapping[str, str]
- Assume role session tags.
- assume_
role_ Sequence[str]transitive_ tag_ keys - Assume role session tag keys to pass to any subsequent sessions.
- encrypt bool
- Whether to enable server side encryption of the state file.
- endpoint str
- A custom endpoint for the S3 API.
- external_
id str - The external ID to use when assuming the role.
- force_
path_ boolstyle - Force s3 to use path-style addressing instead of virtual hosted-bucket addressing. Required by most S3-compatible stores.
- iam_
endpoint str - A custom endpoint for the IAM API.
- kms_
key_ strid - The ARN of a KMS Key to use for encrypting the state.
- max_
retries int - The maximum number of times an AWS API request is retried on retryable failure.
- profile str
- AWS profile name as set in the shared credentials file.
- region str
- AWS region of the S3 bucket. Falls back to the AWS_REGION or AWS_DEFAULT_REGION environment variables when unset.
- role_
arn str - The ARN of an IAM Role to be assumed in order to read the state.
- secret_
key str - AWS secret key.
- session_
name str - The session name to use when assuming the role.
- str
- Path to a shared credentials file.
- skip_
credentials_ boolvalidation - Skip the credentials validation via the STS API.
- skip_
metadata_ boolapi_ check - Skip the AWS Metadata API check.
- skip_
region_ boolvalidation - Skip static validation of region name.
- sse_
customer_ strkey - The base64-encoded encryption key to use for server-side encryption with customer-provided keys (SSE-C).
- sts_
endpoint str - A custom endpoint for the STS API.
- token str
- AWS session token.
- workspace str
- The Terraform workspace to read state from.
- workspace_
key_ strprefix - The prefix applied to the non-default state path inside the bucket.
- bucket String
- The name of the S3 bucket.
- key String
- The path to the state file inside the bucket. When using a non-default workspace, the state path is /workspace_key_prefix/workspace_name/key.
- access
Key String - AWS access key.
- assume
Role NumberDuration Seconds - The duration, in seconds, of the assume role session.
- assume
Role StringPolicy - IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.
- assume
Role List<String>Policy Arns - Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.
- Map<String>
- Assume role session tags.
- assume
Role List<String>Transitive Tag Keys - Assume role session tag keys to pass to any subsequent sessions.
- encrypt Boolean
- Whether to enable server side encryption of the state file.
- endpoint String
- A custom endpoint for the S3 API.
- external
Id String - The external ID to use when assuming the role.
- force
Path BooleanStyle - Force s3 to use path-style addressing instead of virtual hosted-bucket addressing. Required by most S3-compatible stores.
- iam
Endpoint String - A custom endpoint for the IAM API.
- kms
Key StringId - The ARN of a KMS Key to use for encrypting the state.
- max
Retries Number - The maximum number of times an AWS API request is retried on retryable failure.
- profile String
- AWS profile name as set in the shared credentials file.
- region String
- AWS region of the S3 bucket. Falls back to the AWS_REGION or AWS_DEFAULT_REGION environment variables when unset.
- role
Arn String - The ARN of an IAM Role to be assumed in order to read the state.
- secret
Key String - AWS secret key.
- session
Name String - The session name to use when assuming the role.
- String
- Path to a shared credentials file.
- skip
Credentials BooleanValidation - Skip the credentials validation via the STS API.
- skip
Metadata BooleanApi Check - Skip the AWS Metadata API check.
- skip
Region BooleanValidation - Skip static validation of region name.
- sse
Customer StringKey - The base64-encoded encryption key to use for server-side encryption with customer-provided keys (SSE-C).
- sts
Endpoint String - A custom endpoint for the STS API.
- token String
- AWS session token.
- workspace String
- The Terraform workspace to read state from.
- workspace
Key StringPrefix - The prefix applied to the non-default state path inside the bucket.
getS3Reference Result
The following output properties are available:
- Outputs Dictionary<string, object>
- The outputs displayed from Terraform state.
- Outputs map[string]interface{}
- The outputs displayed from Terraform state.
- outputs map(any)
- The outputs displayed from Terraform state.
- outputs Map<String,Object>
- The outputs displayed from Terraform state.
- outputs {[key: string]: any}
- The outputs displayed from Terraform state.
- outputs Mapping[str, Any]
- The outputs displayed from Terraform state.
- outputs Map<Any>
- The outputs displayed from Terraform state.
Package Details
- Repository
- terraform pulumi/pulumi-terraform
- License
- Apache-2.0
Viewing docs for Terraform v6.1.0
published on Monday, Jul 20, 2026 by Pulumi
published on Monday, Jul 20, 2026 by Pulumi