# danubedata.StorageAccessKey
Manages an S3-compatible storage access key for bucket authentication.
Example Usage
Basic Access Key
import * as pulumi from "@pulumi/pulumi";
import * as danubedata from "@danubedata/pulumi";
const main = new danubedata.StorageAccessKey("main", {});
export const accessKeyId = main.accessKeyId;
export const secretAccessKey = main.secretAccessKey;
import pulumi
import pulumi_danubedata as danubedata
main = danubedata.StorageAccessKey("main")
pulumi.export("accessKeyId", main.access_key_id)
pulumi.export("secretAccessKey", main.secret_access_key)
package main
import (
"github.com/AdrianSilaghi/pulumi-danubedata/sdk/go/danubedata"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
main, err := danubedata.NewStorageAccessKey(ctx, "main", nil)
if err != nil {
return err
}
ctx.Export("accessKeyId", main.AccessKeyId)
ctx.Export("secretAccessKey", main.SecretAccessKey)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DanubeData = DanubeData.DanubeData;
return await Deployment.RunAsync(() =>
{
var main = new DanubeData.StorageAccessKey("main");
return new Dictionary<string, object?>
{
["accessKeyId"] = main.AccessKeyId,
["secretAccessKey"] = main.SecretAccessKey,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.danubedata.StorageAccessKey;
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 main = new StorageAccessKey("main");
ctx.export("accessKeyId", main.accessKeyId());
ctx.export("secretAccessKey", main.secretAccessKey());
}
}
resources:
main:
type: danubedata:StorageAccessKey
outputs:
accessKeyId: ${main.accessKeyId}
secretAccessKey: ${main.secretAccessKey}
Using with AWS Provider for S3 Operations
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as danubedata from "@danubedata/pulumi";
const data = new danubedata.StorageBucket("data", {region: "fsn1"});
const s3 = new danubedata.StorageAccessKey("s3", {});
const example = new aws.index.Aws_s3_object("example", {
bucket: data.minioBucketName,
key: "example.txt",
content: "Hello, World!",
}, {
provider: aws.danubedata,
});
import pulumi
import pulumi_aws as aws
import pulumi_danubedata as danubedata
data = danubedata.StorageBucket("data", region="fsn1")
s3 = danubedata.StorageAccessKey("s3")
danubedata = aws.Provider("danubedata",
region="us-east-1",
access_key=s3.access_key_id,
secret_key=s3.secret_access_key,
endpoints=[{
"s3": data.endpoint_url,
}],
skip_credentials_validation=True,
skip_metadata_api_check=True,
skip_requesting_account_id=True,
s3_use_path_style=True)
example = aws.s3.BucketObjectv2("example",
bucket=data.minio_bucket_name,
key="example.txt",
content="Hello, World!",
opts = pulumi.ResourceOptions(provider=aws["danubedata"]))
package main
import (
"github.com/AdrianSilaghi/pulumi-danubedata/sdk/go/danubedata"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
data, err := danubedata.NewStorageBucket(ctx, "data", &danubedata.StorageBucketArgs{
Region: pulumi.String("fsn1"),
})
if err != nil {
return err
}
s3, err := danubedata.NewStorageAccessKey(ctx, "s3", nil)
if err != nil {
return err
}
_, err = aws.NewProvider(ctx, "danubedata", &aws.ProviderArgs{
Region: pulumi.String("us-east-1"),
AccessKey: s3.AccessKeyId,
SecretKey: s3.SecretAccessKey,
Endpoints: aws.ProviderEndpointArray{
&aws.ProviderEndpointArgs{
S3: data.EndpointUrl,
},
},
SkipCredentialsValidation: pulumi.Bool(true),
SkipMetadataApiCheck: pulumi.Bool(true),
SkipRequestingAccountId: pulumi.Bool(true),
S3UsePathStyle: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{
Bucket: data.MinioBucketName,
Key: pulumi.String("example.txt"),
Content: pulumi.String("Hello, World!"),
}, pulumi.Provider(aws.Danubedata))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using DanubeData = DanubeData.DanubeData;
return await Deployment.RunAsync(() =>
{
var data = new DanubeData.StorageBucket("data", new()
{
Region = "fsn1",
});
var s3 = new DanubeData.StorageAccessKey("s3");
var danubedata = new Aws.Provider("danubedata", new()
{
Region = "us-east-1",
AccessKey = s3.AccessKeyId,
SecretKey = s3.SecretAccessKey,
Endpoints = new[]
{
new Aws.Inputs.ProviderEndpointArgs
{
S3 = data.EndpointUrl,
},
},
SkipCredentialsValidation = true,
SkipMetadataApiCheck = true,
SkipRequestingAccountId = true,
S3UsePathStyle = true,
});
var example = new Aws.S3.BucketObjectv2("example", new()
{
Bucket = data.MinioBucketName,
Key = "example.txt",
Content = "Hello, World!",
}, new CustomResourceOptions
{
Provider = aws.Danubedata,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.danubedata.StorageBucket;
import com.pulumi.danubedata.StorageBucketArgs;
import com.pulumi.danubedata.StorageAccessKey;
import com.pulumi.aws.Provider;
import com.pulumi.aws.ProviderArgs;
import com.pulumi.aws.inputs.ProviderEndpointArgs;
import com.pulumi.aws.s3.BucketObjectv2;
import com.pulumi.aws.s3.BucketObjectv2Args;
import com.pulumi.resources.CustomResourceOptions;
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 data = new StorageBucket("data", StorageBucketArgs.builder()
.region("fsn1")
.build());
var s3 = new StorageAccessKey("s3");
var danubedata = new Provider("danubedata", ProviderArgs.builder()
.region("us-east-1")
.accessKey(s3.accessKeyId())
.secretKey(s3.secretAccessKey())
.endpoints(ProviderEndpointArgs.builder()
.s3(data.endpointUrl())
.build())
.skipCredentialsValidation(true)
.skipMetadataApiCheck(true)
.skipRequestingAccountId(true)
.s3UsePathStyle(true)
.build());
var example = new BucketObjectv2("example", BucketObjectv2Args.builder()
.bucket(data.minioBucketName())
.key("example.txt")
.content("Hello, World!")
.build(), CustomResourceOptions.builder()
.provider(aws.danubedata())
.build());
}
}
resources:
data:
type: danubedata:StorageBucket
properties:
region: fsn1
s3:
type: danubedata:StorageAccessKey
danubedata:
type: pulumi:providers:aws
properties:
region: us-east-1 # Required but ignored
accessKey: ${s3.accessKeyId}
secretKey: ${s3.secretAccessKey}
endpoints:
- s3: ${data.endpointUrl}
skipCredentialsValidation: true
skipMetadataApiCheck: true
skipRequestingAccountId: true
s3UsePathStyle: true
example:
type: aws:s3:BucketObjectv2
properties:
bucket: ${data.minioBucketName}
key: example.txt
content: Hello, World!
options:
provider: ${aws.danubedata}
Create StorageAccessKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new StorageAccessKey(name: string, args?: StorageAccessKeyArgs, opts?: CustomResourceOptions);@overload
def StorageAccessKey(resource_name: str,
args: Optional[StorageAccessKeyArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def StorageAccessKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
expires_at: Optional[str] = None,
name: Optional[str] = None)func NewStorageAccessKey(ctx *Context, name string, args *StorageAccessKeyArgs, opts ...ResourceOption) (*StorageAccessKey, error)public StorageAccessKey(string name, StorageAccessKeyArgs? args = null, CustomResourceOptions? opts = null)
public StorageAccessKey(String name, StorageAccessKeyArgs args)
public StorageAccessKey(String name, StorageAccessKeyArgs args, CustomResourceOptions options)
type: danubedata:StorageAccessKey
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 StorageAccessKeyArgs
- 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 StorageAccessKeyArgs
- 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 StorageAccessKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StorageAccessKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args StorageAccessKeyArgs
- 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 storageAccessKeyResource = new DanubeData.StorageAccessKey("storageAccessKeyResource", new()
{
ExpiresAt = "string",
Name = "string",
});
example, err := danubedata.NewStorageAccessKey(ctx, "storageAccessKeyResource", &danubedata.StorageAccessKeyArgs{
ExpiresAt: pulumi.String("string"),
Name: pulumi.String("string"),
})
var storageAccessKeyResource = new StorageAccessKey("storageAccessKeyResource", StorageAccessKeyArgs.builder()
.expiresAt("string")
.name("string")
.build());
storage_access_key_resource = danubedata.StorageAccessKey("storageAccessKeyResource",
expires_at="string",
name="string")
const storageAccessKeyResource = new danubedata.StorageAccessKey("storageAccessKeyResource", {
expiresAt: "string",
name: "string",
});
type: danubedata:StorageAccessKey
properties:
expiresAt: string
name: string
StorageAccessKey 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 StorageAccessKey resource accepts the following input properties:
- expires_
at str - Optional expiration date for the access key (ISO 8601 format).
- name str
- Name of the access key.
Outputs
All input properties are implicitly available as output properties. Additionally, the StorageAccessKey resource produces the following output properties:
- Access
Key stringId - The S3 access key ID for authentication.
- Created
At string - Creation timestamp.
- Id string
- The provider-assigned unique ID for this managed resource.
- Secret
Access stringKey - The S3 secret access key for authentication. Only available after creation.
- Status string
- Current status of the key.
- Updated
At string - Timestamp when the access key was last updated.
- Access
Key stringId - The S3 access key ID for authentication.
- Created
At string - Creation timestamp.
- Id string
- The provider-assigned unique ID for this managed resource.
- Secret
Access stringKey - The S3 secret access key for authentication. Only available after creation.
- Status string
- Current status of the key.
- Updated
At string - Timestamp when the access key was last updated.
- access
Key StringId - The S3 access key ID for authentication.
- created
At String - Creation timestamp.
- id String
- The provider-assigned unique ID for this managed resource.
- secret
Access StringKey - The S3 secret access key for authentication. Only available after creation.
- status String
- Current status of the key.
- updated
At String - Timestamp when the access key was last updated.
- access
Key stringId - The S3 access key ID for authentication.
- created
At string - Creation timestamp.
- id string
- The provider-assigned unique ID for this managed resource.
- secret
Access stringKey - The S3 secret access key for authentication. Only available after creation.
- status string
- Current status of the key.
- updated
At string - Timestamp when the access key was last updated.
- access_
key_ strid - The S3 access key ID for authentication.
- created_
at str - Creation timestamp.
- id str
- The provider-assigned unique ID for this managed resource.
- secret_
access_ strkey - The S3 secret access key for authentication. Only available after creation.
- status str
- Current status of the key.
- updated_
at str - Timestamp when the access key was last updated.
- access
Key StringId - The S3 access key ID for authentication.
- created
At String - Creation timestamp.
- id String
- The provider-assigned unique ID for this managed resource.
- secret
Access StringKey - The S3 secret access key for authentication. Only available after creation.
- status String
- Current status of the key.
- updated
At String - Timestamp when the access key was last updated.
Look up Existing StorageAccessKey Resource
Get an existing StorageAccessKey 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?: StorageAccessKeyState, opts?: CustomResourceOptions): StorageAccessKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_key_id: Optional[str] = None,
created_at: Optional[str] = None,
expires_at: Optional[str] = None,
name: Optional[str] = None,
secret_access_key: Optional[str] = None,
status: Optional[str] = None,
updated_at: Optional[str] = None) -> StorageAccessKeyfunc GetStorageAccessKey(ctx *Context, name string, id IDInput, state *StorageAccessKeyState, opts ...ResourceOption) (*StorageAccessKey, error)public static StorageAccessKey Get(string name, Input<string> id, StorageAccessKeyState? state, CustomResourceOptions? opts = null)public static StorageAccessKey get(String name, Output<String> id, StorageAccessKeyState state, CustomResourceOptions options)resources: _: type: danubedata:StorageAccessKey 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.
- Access
Key stringId - The S3 access key ID for authentication.
- Created
At string - Creation timestamp.
- Expires
At string - Optional expiration date for the access key (ISO 8601 format).
- Name string
- Name of the access key.
- Secret
Access stringKey - The S3 secret access key for authentication. Only available after creation.
- Status string
- Current status of the key.
- Updated
At string - Timestamp when the access key was last updated.
- Access
Key stringId - The S3 access key ID for authentication.
- Created
At string - Creation timestamp.
- Expires
At string - Optional expiration date for the access key (ISO 8601 format).
- Name string
- Name of the access key.
- Secret
Access stringKey - The S3 secret access key for authentication. Only available after creation.
- Status string
- Current status of the key.
- Updated
At string - Timestamp when the access key was last updated.
- access
Key StringId - The S3 access key ID for authentication.
- created
At String - Creation timestamp.
- expires
At String - Optional expiration date for the access key (ISO 8601 format).
- name String
- Name of the access key.
- secret
Access StringKey - The S3 secret access key for authentication. Only available after creation.
- status String
- Current status of the key.
- updated
At String - Timestamp when the access key was last updated.
- access
Key stringId - The S3 access key ID for authentication.
- created
At string - Creation timestamp.
- expires
At string - Optional expiration date for the access key (ISO 8601 format).
- name string
- Name of the access key.
- secret
Access stringKey - The S3 secret access key for authentication. Only available after creation.
- status string
- Current status of the key.
- updated
At string - Timestamp when the access key was last updated.
- access_
key_ strid - The S3 access key ID for authentication.
- created_
at str - Creation timestamp.
- expires_
at str - Optional expiration date for the access key (ISO 8601 format).
- name str
- Name of the access key.
- secret_
access_ strkey - The S3 secret access key for authentication. Only available after creation.
- status str
- Current status of the key.
- updated_
at str - Timestamp when the access key was last updated.
- access
Key StringId - The S3 access key ID for authentication.
- created
At String - Creation timestamp.
- expires
At String - Optional expiration date for the access key (ISO 8601 format).
- name String
- Name of the access key.
- secret
Access StringKey - The S3 secret access key for authentication. Only available after creation.
- status String
- Current status of the key.
- updated
At String - Timestamp when the access key was last updated.
Import
Storage access keys can be imported using their ID:
bash
$ pulumi import danubedata:index/storageAccessKey:StorageAccessKey example key-abc123
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- danubedata AdrianSilaghi/pulumi-danubedata
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
danubedataTerraform Provider.
