minio.S3Object
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as minio from "@pulumi/minio";
const stateTerraformS3 = new minio.S3Bucket("state_terraform_s3", {
bucket: "state-terraform-s3",
acl: "public",
});
const txtFile = new minio.S3Object("txt_file", {
bucketName: stateTerraformS3.bucket,
objectName: "text.txt",
content: "Lorem ipsum dolor sit amet.",
contentType: "text/plain",
}, {
dependsOn: [stateTerraformS3],
});
export const minioId = txtFile.id;
import pulumi
import pulumi_minio as minio
state_terraform_s3 = minio.S3Bucket("state_terraform_s3",
bucket="state-terraform-s3",
acl="public")
txt_file = minio.S3Object("txt_file",
bucket_name=state_terraform_s3.bucket,
object_name="text.txt",
content="Lorem ipsum dolor sit amet.",
content_type="text/plain",
opts = pulumi.ResourceOptions(depends_on=[state_terraform_s3]))
pulumi.export("minioId", txt_file.id)
package main
import (
"github.com/pulumi/pulumi-minio/sdk/go/minio"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
stateTerraformS3, err := minio.NewS3Bucket(ctx, "state_terraform_s3", &minio.S3BucketArgs{
Bucket: pulumi.String("state-terraform-s3"),
Acl: pulumi.String("public"),
})
if err != nil {
return err
}
txtFile, err := minio.NewS3Object(ctx, "txt_file", &minio.S3ObjectArgs{
BucketName: stateTerraformS3.Bucket,
ObjectName: pulumi.String("text.txt"),
Content: pulumi.String("Lorem ipsum dolor sit amet."),
ContentType: pulumi.String("text/plain"),
}, pulumi.DependsOn([]pulumi.Resource{
stateTerraformS3,
}))
if err != nil {
return err
}
ctx.Export("minioId", txtFile.ID())
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Minio = Pulumi.Minio;
return await Deployment.RunAsync(() =>
{
var stateTerraformS3 = new Minio.S3Bucket("state_terraform_s3", new()
{
Bucket = "state-terraform-s3",
Acl = "public",
});
var txtFile = new Minio.S3Object("txt_file", new()
{
BucketName = stateTerraformS3.Bucket,
ObjectName = "text.txt",
Content = "Lorem ipsum dolor sit amet.",
ContentType = "text/plain",
}, new CustomResourceOptions
{
DependsOn =
{
stateTerraformS3,
},
});
return new Dictionary<string, object?>
{
["minioId"] = txtFile.Id,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.minio.S3Bucket;
import com.pulumi.minio.S3BucketArgs;
import com.pulumi.minio.S3Object;
import com.pulumi.minio.S3ObjectArgs;
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 stateTerraformS3 = new S3Bucket("stateTerraformS3", S3BucketArgs.builder()
.bucket("state-terraform-s3")
.acl("public")
.build());
var txtFile = new S3Object("txtFile", S3ObjectArgs.builder()
.bucketName(stateTerraformS3.bucket())
.objectName("text.txt")
.content("Lorem ipsum dolor sit amet.")
.contentType("text/plain")
.build(), CustomResourceOptions.builder()
.dependsOn(stateTerraformS3)
.build());
ctx.export("minioId", txtFile.id());
}
}
resources:
stateTerraformS3:
type: minio:S3Bucket
name: state_terraform_s3
properties:
bucket: state-terraform-s3
acl: public
txtFile:
type: minio:S3Object
name: txt_file
properties:
bucketName: ${stateTerraformS3.bucket}
objectName: text.txt
content: Lorem ipsum dolor sit amet.
contentType: text/plain
options:
dependson:
- ${stateTerraformS3}
outputs:
minioId: ${txtFile.id}
Create S3Object Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new S3Object(name: string, args: S3ObjectArgs, opts?: CustomResourceOptions);
@overload
def S3Object(resource_name: str,
args: S3ObjectArgs,
opts: Optional[ResourceOptions] = None)
@overload
def S3Object(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket_name: Optional[str] = None,
object_name: Optional[str] = None,
content: Optional[str] = None,
content_base64: Optional[str] = None,
content_type: Optional[str] = None,
etag: Optional[str] = None,
source: Optional[str] = None,
version_id: Optional[str] = None)
func NewS3Object(ctx *Context, name string, args S3ObjectArgs, opts ...ResourceOption) (*S3Object, error)
public S3Object(string name, S3ObjectArgs args, CustomResourceOptions? opts = null)
public S3Object(String name, S3ObjectArgs args)
public S3Object(String name, S3ObjectArgs args, CustomResourceOptions options)
type: minio:S3Object
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 S3ObjectArgs
- 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 S3ObjectArgs
- 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 S3ObjectArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args S3ObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args S3ObjectArgs
- 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 s3objectResource = new Minio.S3Object("s3objectResource", new()
{
BucketName = "string",
ObjectName = "string",
Content = "string",
ContentBase64 = "string",
ContentType = "string",
Etag = "string",
Source = "string",
VersionId = "string",
});
example, err := minio.NewS3Object(ctx, "s3objectResource", &minio.S3ObjectArgs{
BucketName: pulumi.String("string"),
ObjectName: pulumi.String("string"),
Content: pulumi.String("string"),
ContentBase64: pulumi.String("string"),
ContentType: pulumi.String("string"),
Etag: pulumi.String("string"),
Source: pulumi.String("string"),
VersionId: pulumi.String("string"),
})
var s3objectResource = new S3Object("s3objectResource", S3ObjectArgs.builder()
.bucketName("string")
.objectName("string")
.content("string")
.contentBase64("string")
.contentType("string")
.etag("string")
.source("string")
.versionId("string")
.build());
s3object_resource = minio.S3Object("s3objectResource",
bucket_name="string",
object_name="string",
content="string",
content_base64="string",
content_type="string",
etag="string",
source="string",
version_id="string")
const s3objectResource = new minio.S3Object("s3objectResource", {
bucketName: "string",
objectName: "string",
content: "string",
contentBase64: "string",
contentType: "string",
etag: "string",
source: "string",
versionId: "string",
});
type: minio:S3Object
properties:
bucketName: string
content: string
contentBase64: string
contentType: string
etag: string
objectName: string
source: string
versionId: string
S3Object 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 S3Object resource accepts the following input properties:
- Bucket
Name string - Object
Name string - Content string
- Content
Base64 string - Content
Type string - Etag string
- Source string
- Version
Id string
- Bucket
Name string - Object
Name string - Content string
- Content
Base64 string - Content
Type string - Etag string
- Source string
- Version
Id string
- bucket
Name String - object
Name String - content String
- content
Base64 String - content
Type String - etag String
- source String
- version
Id String
- bucket
Name string - object
Name string - content string
- content
Base64 string - content
Type string - etag string
- source string
- version
Id string
- bucket_
name str - object_
name str - content str
- content_
base64 str - content_
type str - etag str
- source str
- version_
id str
- bucket
Name String - object
Name String - content String
- content
Base64 String - content
Type String - etag String
- source String
- version
Id String
Outputs
All input properties are implicitly available as output properties. Additionally, the S3Object 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 S3Object Resource
Get an existing S3Object 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?: S3ObjectState, opts?: CustomResourceOptions): S3Object
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket_name: Optional[str] = None,
content: Optional[str] = None,
content_base64: Optional[str] = None,
content_type: Optional[str] = None,
etag: Optional[str] = None,
object_name: Optional[str] = None,
source: Optional[str] = None,
version_id: Optional[str] = None) -> S3Object
func GetS3Object(ctx *Context, name string, id IDInput, state *S3ObjectState, opts ...ResourceOption) (*S3Object, error)
public static S3Object Get(string name, Input<string> id, S3ObjectState? state, CustomResourceOptions? opts = null)
public static S3Object get(String name, Output<String> id, S3ObjectState 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.
- Bucket
Name string - Content string
- Content
Base64 string - Content
Type string - Etag string
- Object
Name string - Source string
- Version
Id string
- Bucket
Name string - Content string
- Content
Base64 string - Content
Type string - Etag string
- Object
Name string - Source string
- Version
Id string
- bucket
Name String - content String
- content
Base64 String - content
Type String - etag String
- object
Name String - source String
- version
Id String
- bucket
Name string - content string
- content
Base64 string - content
Type string - etag string
- object
Name string - source string
- version
Id string
- bucket_
name str - content str
- content_
base64 str - content_
type str - etag str
- object_
name str - source str
- version_
id str
- bucket
Name String - content String
- content
Base64 String - content
Type String - etag String
- object
Name String - source String
- version
Id String
Package Details
- Repository
- MinIO pulumi/pulumi-minio
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
minio
Terraform Provider.