openstack.objectstorage.TempUrl
Explore with Pulumi AI
Use this resource to generate an OpenStack Object Storage temporary URL.
The temporary URL will be valid for as long as TTL is set to (in seconds).
Once the URL has expired, it will no longer be valid, but the resource
will remain in place. If you wish to automatically regenerate a URL, set
the regenerate
argument to true
. This will create a new resource with
a new ID and URL.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const container1 = new openstack.objectstorage.Container("container_1", {
name: "test",
metadata: {
"Temp-URL-Key": "testkey",
},
});
const object1 = new openstack.objectstorage.ContainerObject("object_1", {
containerName: container1.name,
name: "test",
content: "Hello, world!",
});
const objTempurl = new openstack.objectstorage.TempUrl("obj_tempurl", {
container: container1.name,
object: object1.name,
method: "post",
ttl: 20,
});
import pulumi
import pulumi_openstack as openstack
container1 = openstack.objectstorage.Container("container_1",
name="test",
metadata={
"Temp-URL-Key": "testkey",
})
object1 = openstack.objectstorage.ContainerObject("object_1",
container_name=container1.name,
name="test",
content="Hello, world!")
obj_tempurl = openstack.objectstorage.TempUrl("obj_tempurl",
container=container1.name,
object=object1.name,
method="post",
ttl=20)
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v4/go/openstack/objectstorage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
container1, err := objectstorage.NewContainer(ctx, "container_1", &objectstorage.ContainerArgs{
Name: pulumi.String("test"),
Metadata: pulumi.StringMap{
"Temp-URL-Key": pulumi.String("testkey"),
},
})
if err != nil {
return err
}
object1, err := objectstorage.NewContainerObject(ctx, "object_1", &objectstorage.ContainerObjectArgs{
ContainerName: container1.Name,
Name: pulumi.String("test"),
Content: pulumi.String("Hello, world!"),
})
if err != nil {
return err
}
_, err = objectstorage.NewTempUrl(ctx, "obj_tempurl", &objectstorage.TempUrlArgs{
Container: container1.Name,
Object: object1.Name,
Method: pulumi.String("post"),
Ttl: pulumi.Int(20),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() =>
{
var container1 = new OpenStack.ObjectStorage.Container("container_1", new()
{
Name = "test",
Metadata =
{
{ "Temp-URL-Key", "testkey" },
},
});
var object1 = new OpenStack.ObjectStorage.ContainerObject("object_1", new()
{
ContainerName = container1.Name,
Name = "test",
Content = "Hello, world!",
});
var objTempurl = new OpenStack.ObjectStorage.TempUrl("obj_tempurl", new()
{
Container = container1.Name,
Object = object1.Name,
Method = "post",
Ttl = 20,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.objectstorage.Container;
import com.pulumi.openstack.objectstorage.ContainerArgs;
import com.pulumi.openstack.objectstorage.ContainerObject;
import com.pulumi.openstack.objectstorage.ContainerObjectArgs;
import com.pulumi.openstack.objectstorage.TempUrl;
import com.pulumi.openstack.objectstorage.TempUrlArgs;
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 container1 = new Container("container1", ContainerArgs.builder()
.name("test")
.metadata(Map.of("Temp-URL-Key", "testkey"))
.build());
var object1 = new ContainerObject("object1", ContainerObjectArgs.builder()
.containerName(container1.name())
.name("test")
.content("Hello, world!")
.build());
var objTempurl = new TempUrl("objTempurl", TempUrlArgs.builder()
.container(container1.name())
.object(object1.name())
.method("post")
.ttl(20)
.build());
}
}
resources:
container1:
type: openstack:objectstorage:Container
name: container_1
properties:
name: test
metadata:
Temp-URL-Key: testkey
object1:
type: openstack:objectstorage:ContainerObject
name: object_1
properties:
containerName: ${container1.name}
name: test
content: Hello, world!
objTempurl:
type: openstack:objectstorage:TempUrl
name: obj_tempurl
properties:
container: ${container1.name}
object: ${object1.name}
method: post
ttl: 20
Create TempUrl Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TempUrl(name: string, args: TempUrlArgs, opts?: CustomResourceOptions);
@overload
def TempUrl(resource_name: str,
args: TempUrlArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TempUrl(resource_name: str,
opts: Optional[ResourceOptions] = None,
container: Optional[str] = None,
object: Optional[str] = None,
ttl: Optional[int] = None,
method: Optional[str] = None,
regenerate: Optional[bool] = None,
region: Optional[str] = None,
split: Optional[str] = None)
func NewTempUrl(ctx *Context, name string, args TempUrlArgs, opts ...ResourceOption) (*TempUrl, error)
public TempUrl(string name, TempUrlArgs args, CustomResourceOptions? opts = null)
public TempUrl(String name, TempUrlArgs args)
public TempUrl(String name, TempUrlArgs args, CustomResourceOptions options)
type: openstack:objectstorage:TempUrl
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 TempUrlArgs
- 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 TempUrlArgs
- 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 TempUrlArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TempUrlArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TempUrlArgs
- 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 tempUrlResource = new OpenStack.ObjectStorage.TempUrl("tempUrlResource", new()
{
Container = "string",
Object = "string",
Ttl = 0,
Method = "string",
Regenerate = false,
Region = "string",
Split = "string",
});
example, err := objectstorage.NewTempUrl(ctx, "tempUrlResource", &objectstorage.TempUrlArgs{
Container: pulumi.String("string"),
Object: pulumi.String("string"),
Ttl: pulumi.Int(0),
Method: pulumi.String("string"),
Regenerate: pulumi.Bool(false),
Region: pulumi.String("string"),
Split: pulumi.String("string"),
})
var tempUrlResource = new TempUrl("tempUrlResource", TempUrlArgs.builder()
.container("string")
.object("string")
.ttl(0)
.method("string")
.regenerate(false)
.region("string")
.split("string")
.build());
temp_url_resource = openstack.objectstorage.TempUrl("tempUrlResource",
container="string",
object="string",
ttl=0,
method="string",
regenerate=False,
region="string",
split="string")
const tempUrlResource = new openstack.objectstorage.TempUrl("tempUrlResource", {
container: "string",
object: "string",
ttl: 0,
method: "string",
regenerate: false,
region: "string",
split: "string",
});
type: openstack:objectstorage:TempUrl
properties:
container: string
method: string
object: string
regenerate: false
region: string
split: string
ttl: 0
TempUrl Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The TempUrl resource accepts the following input properties:
- Container string
- The container name the object belongs to.
- Object string
- The object name the tempurl is for.
- Ttl int
- The TTL, in seconds, for the URL. For how long it should be valid.
- Method string
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - Regenerate bool
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- Region string
- The region the tempurl is located in.
- Split string
- Container string
- The container name the object belongs to.
- Object string
- The object name the tempurl is for.
- Ttl int
- The TTL, in seconds, for the URL. For how long it should be valid.
- Method string
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - Regenerate bool
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- Region string
- The region the tempurl is located in.
- Split string
- container String
- The container name the object belongs to.
- object String
- The object name the tempurl is for.
- ttl Integer
- The TTL, in seconds, for the URL. For how long it should be valid.
- method String
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - regenerate Boolean
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- region String
- The region the tempurl is located in.
- split String
- container string
- The container name the object belongs to.
- object string
- The object name the tempurl is for.
- ttl number
- The TTL, in seconds, for the URL. For how long it should be valid.
- method string
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - regenerate boolean
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- region string
- The region the tempurl is located in.
- split string
- container str
- The container name the object belongs to.
- object str
- The object name the tempurl is for.
- ttl int
- The TTL, in seconds, for the URL. For how long it should be valid.
- method str
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - regenerate bool
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- region str
- The region the tempurl is located in.
- split str
- container String
- The container name the object belongs to.
- object String
- The object name the tempurl is for.
- ttl Number
- The TTL, in seconds, for the URL. For how long it should be valid.
- method String
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - regenerate Boolean
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- region String
- The region the tempurl is located in.
- split String
Outputs
All input properties are implicitly available as output properties. Additionally, the TempUrl resource produces the following output properties:
Look up Existing TempUrl Resource
Get an existing TempUrl 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?: TempUrlState, opts?: CustomResourceOptions): TempUrl
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
container: Optional[str] = None,
method: Optional[str] = None,
object: Optional[str] = None,
regenerate: Optional[bool] = None,
region: Optional[str] = None,
split: Optional[str] = None,
ttl: Optional[int] = None,
url: Optional[str] = None) -> TempUrl
func GetTempUrl(ctx *Context, name string, id IDInput, state *TempUrlState, opts ...ResourceOption) (*TempUrl, error)
public static TempUrl Get(string name, Input<string> id, TempUrlState? state, CustomResourceOptions? opts = null)
public static TempUrl get(String name, Output<String> id, TempUrlState 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.
- Container string
- The container name the object belongs to.
- Method string
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - Object string
- The object name the tempurl is for.
- Regenerate bool
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- Region string
- The region the tempurl is located in.
- Split string
- Ttl int
- The TTL, in seconds, for the URL. For how long it should be valid.
- Url string
- The URL
- Container string
- The container name the object belongs to.
- Method string
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - Object string
- The object name the tempurl is for.
- Regenerate bool
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- Region string
- The region the tempurl is located in.
- Split string
- Ttl int
- The TTL, in seconds, for the URL. For how long it should be valid.
- Url string
- The URL
- container String
- The container name the object belongs to.
- method String
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - object String
- The object name the tempurl is for.
- regenerate Boolean
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- region String
- The region the tempurl is located in.
- split String
- ttl Integer
- The TTL, in seconds, for the URL. For how long it should be valid.
- url String
- The URL
- container string
- The container name the object belongs to.
- method string
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - object string
- The object name the tempurl is for.
- regenerate boolean
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- region string
- The region the tempurl is located in.
- split string
- ttl number
- The TTL, in seconds, for the URL. For how long it should be valid.
- url string
- The URL
- container str
- The container name the object belongs to.
- method str
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - object str
- The object name the tempurl is for.
- regenerate bool
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- region str
- The region the tempurl is located in.
- split str
- ttl int
- The TTL, in seconds, for the URL. For how long it should be valid.
- url str
- The URL
- container String
- The container name the object belongs to.
- method String
- The method allowed when accessing this URL.
Valid values are
GET
, andPOST
. Default isGET
. - object String
- The object name the tempurl is for.
- regenerate Boolean
- Whether to automatically regenerate the URL when it has expired. If set to true, this will create a new resource with a new ID and new URL. Defaults to false.
- region String
- The region the tempurl is located in.
- split String
- ttl Number
- The TTL, in seconds, for the URL. For how long it should be valid.
- url String
- The URL
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.