ovh.StorageEfsShareSnapshot
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
import * as time from "@pulumi/time";
const efs = ovh.getStorageEfs({
serviceName: "XXX",
});
// This resource will destroy (at least) 10 seconds after ovh_storage_efs_share_snapshot resource
const share = new ovh.StorageEfsShare("share", {
serviceName: efs.then(efs => efs.serviceName),
name: "share",
description: "My share",
protocol: "NFS",
size: 100,
});
// This resource adds a delay between ovh_storage_efs_share_snapshot and ovh_storage_efs_share resources destruction
const wait10Seconds = new time.index.Sleep("wait_10_seconds", {destroyDuration: "10s"}, {
dependsOn: [share],
});
const snapshot = new ovh.StorageEfsShareSnapshot("snapshot", {
serviceName: efs.then(efs => efs.serviceName),
shareId: share.id,
name: "snapshot",
description: "My snapshot",
}, {
dependsOn: [wait10Seconds],
});
import pulumi
import pulumi_ovh as ovh
import pulumi_time as time
efs = ovh.get_storage_efs(service_name="XXX")
# This resource will destroy (at least) 10 seconds after ovh_storage_efs_share_snapshot resource
share = ovh.StorageEfsShare("share",
service_name=efs.service_name,
name="share",
description="My share",
protocol="NFS",
size=100)
# This resource adds a delay between ovh_storage_efs_share_snapshot and ovh_storage_efs_share resources destruction
wait10_seconds = time.index.Sleep("wait_10_seconds", destroy_duration=10s,
opts = pulumi.ResourceOptions(depends_on=[share]))
snapshot = ovh.StorageEfsShareSnapshot("snapshot",
service_name=efs.service_name,
share_id=share.id,
name="snapshot",
description="My snapshot",
opts = pulumi.ResourceOptions(depends_on=[wait10_seconds]))
package main
import (
"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh"
"github.com/pulumi/pulumi-time/sdk/go/time"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
efs, err := ovh.GetStorageEfs(ctx, &ovh.GetStorageEfsArgs{
ServiceName: "XXX",
}, nil)
if err != nil {
return err
}
// This resource will destroy (at least) 10 seconds after ovh_storage_efs_share_snapshot resource
share, err := ovh.NewStorageEfsShare(ctx, "share", &ovh.StorageEfsShareArgs{
ServiceName: pulumi.String(efs.ServiceName),
Name: pulumi.String("share"),
Description: pulumi.String("My share"),
Protocol: pulumi.String("NFS"),
Size: pulumi.Float64(100),
})
if err != nil {
return err
}
// This resource adds a delay between ovh_storage_efs_share_snapshot and ovh_storage_efs_share resources destruction
wait10Seconds, err := time.NewSleep(ctx, "wait_10_seconds", &time.SleepArgs{
DestroyDuration: "10s",
}, pulumi.DependsOn([]pulumi.Resource{
share,
}))
if err != nil {
return err
}
_, err = ovh.NewStorageEfsShareSnapshot(ctx, "snapshot", &ovh.StorageEfsShareSnapshotArgs{
ServiceName: pulumi.String(efs.ServiceName),
ShareId: share.ID(),
Name: pulumi.String("snapshot"),
Description: pulumi.String("My snapshot"),
}, pulumi.DependsOn([]pulumi.Resource{
wait10Seconds,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
using Time = Pulumi.Time;
return await Deployment.RunAsync(() =>
{
var efs = Ovh.GetStorageEfs.Invoke(new()
{
ServiceName = "XXX",
});
// This resource will destroy (at least) 10 seconds after ovh_storage_efs_share_snapshot resource
var share = new Ovh.StorageEfsShare("share", new()
{
ServiceName = efs.Apply(getStorageEfsResult => getStorageEfsResult.ServiceName),
Name = "share",
Description = "My share",
Protocol = "NFS",
Size = 100,
});
// This resource adds a delay between ovh_storage_efs_share_snapshot and ovh_storage_efs_share resources destruction
var wait10Seconds = new Time.Index.Sleep("wait_10_seconds", new()
{
DestroyDuration = "10s",
}, new CustomResourceOptions
{
DependsOn =
{
share,
},
});
var snapshot = new Ovh.StorageEfsShareSnapshot("snapshot", new()
{
ServiceName = efs.Apply(getStorageEfsResult => getStorageEfsResult.ServiceName),
ShareId = share.Id,
Name = "snapshot",
Description = "My snapshot",
}, new CustomResourceOptions
{
DependsOn =
{
wait10Seconds,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.OvhFunctions;
import com.pulumi.ovh.inputs.GetStorageEfsArgs;
import com.ovhcloud.pulumi.ovh.StorageEfsShare;
import com.ovhcloud.pulumi.ovh.StorageEfsShareArgs;
import com.pulumi.time.sleep;
import com.pulumi.time.sleepArgs;
import com.ovhcloud.pulumi.ovh.StorageEfsShareSnapshot;
import com.ovhcloud.pulumi.ovh.StorageEfsShareSnapshotArgs;
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) {
final var efs = OvhFunctions.getStorageEfs(GetStorageEfsArgs.builder()
.serviceName("XXX")
.build());
// This resource will destroy (at least) 10 seconds after ovh_storage_efs_share_snapshot resource
var share = new StorageEfsShare("share", StorageEfsShareArgs.builder()
.serviceName(efs.serviceName())
.name("share")
.description("My share")
.protocol("NFS")
.size(100.0)
.build());
// This resource adds a delay between ovh_storage_efs_share_snapshot and ovh_storage_efs_share resources destruction
var wait10Seconds = new Sleep("wait10Seconds", SleepArgs.builder()
.destroyDuration("10s")
.build(), CustomResourceOptions.builder()
.dependsOn(List.of(share))
.build());
var snapshot = new StorageEfsShareSnapshot("snapshot", StorageEfsShareSnapshotArgs.builder()
.serviceName(efs.serviceName())
.shareId(share.id())
.name("snapshot")
.description("My snapshot")
.build(), CustomResourceOptions.builder()
.dependsOn(wait10Seconds)
.build());
}
}
resources:
# This resource will destroy (at least) 10 seconds after ovh_storage_efs_share_snapshot resource
share:
type: ovh:StorageEfsShare
properties:
serviceName: ${efs.serviceName}
name: share
description: My share
protocol: NFS
size: 100
snapshot:
type: ovh:StorageEfsShareSnapshot
properties:
serviceName: ${efs.serviceName}
shareId: ${share.id}
name: snapshot
description: My snapshot
options:
dependsOn:
- ${wait10Seconds}
# This resource adds a delay between ovh_storage_efs_share_snapshot and ovh_storage_efs_share resources destruction
wait10Seconds:
type: time:sleep
name: wait_10_seconds
properties:
destroyDuration: 10s
options:
dependsOn:
- ${share}
variables:
efs:
fn::invoke:
function: ovh:getStorageEfs
arguments:
serviceName: XXX
Create StorageEfsShareSnapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new StorageEfsShareSnapshot(name: string, args: StorageEfsShareSnapshotArgs, opts?: CustomResourceOptions);
@overload
def StorageEfsShareSnapshot(resource_name: str,
args: StorageEfsShareSnapshotArgs,
opts: Optional[ResourceOptions] = None)
@overload
def StorageEfsShareSnapshot(resource_name: str,
opts: Optional[ResourceOptions] = None,
service_name: Optional[str] = None,
share_id: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None)
func NewStorageEfsShareSnapshot(ctx *Context, name string, args StorageEfsShareSnapshotArgs, opts ...ResourceOption) (*StorageEfsShareSnapshot, error)
public StorageEfsShareSnapshot(string name, StorageEfsShareSnapshotArgs args, CustomResourceOptions? opts = null)
public StorageEfsShareSnapshot(String name, StorageEfsShareSnapshotArgs args)
public StorageEfsShareSnapshot(String name, StorageEfsShareSnapshotArgs args, CustomResourceOptions options)
type: ovh:StorageEfsShareSnapshot
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 StorageEfsShareSnapshotArgs
- 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 StorageEfsShareSnapshotArgs
- 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 StorageEfsShareSnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StorageEfsShareSnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args StorageEfsShareSnapshotArgs
- 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 storageEfsShareSnapshotResource = new Ovh.StorageEfsShareSnapshot("storageEfsShareSnapshotResource", new()
{
ServiceName = "string",
ShareId = "string",
Description = "string",
Name = "string",
});
example, err := ovh.NewStorageEfsShareSnapshot(ctx, "storageEfsShareSnapshotResource", &ovh.StorageEfsShareSnapshotArgs{
ServiceName: pulumi.String("string"),
ShareId: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
var storageEfsShareSnapshotResource = new StorageEfsShareSnapshot("storageEfsShareSnapshotResource", StorageEfsShareSnapshotArgs.builder()
.serviceName("string")
.shareId("string")
.description("string")
.name("string")
.build());
storage_efs_share_snapshot_resource = ovh.StorageEfsShareSnapshot("storageEfsShareSnapshotResource",
service_name="string",
share_id="string",
description="string",
name="string")
const storageEfsShareSnapshotResource = new ovh.StorageEfsShareSnapshot("storageEfsShareSnapshotResource", {
serviceName: "string",
shareId: "string",
description: "string",
name: "string",
});
type: ovh:StorageEfsShareSnapshot
properties:
description: string
name: string
serviceName: string
shareId: string
StorageEfsShareSnapshot 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 StorageEfsShareSnapshot resource accepts the following input properties:
- Service
Name string - Service name
- string
- Share ID
- Description string
- Snapshot description
- Name string
- Snapshot name
- Service
Name string - Service name
- string
- Share ID
- Description string
- Snapshot description
- Name string
- Snapshot name
- service
Name String - Service name
- String
- Share ID
- description String
- Snapshot description
- name String
- Snapshot name
- service
Name string - Service name
- string
- Share ID
- description string
- Snapshot description
- name string
- Snapshot name
- service_
name str - Service name
- str
- Share ID
- description str
- Snapshot description
- name str
- Snapshot name
- service
Name String - Service name
- String
- Share ID
- description String
- Snapshot description
- name String
- Snapshot name
Outputs
All input properties are implicitly available as output properties. Additionally, the StorageEfsShareSnapshot resource produces the following output properties:
- created_
at str - Snapshot creation date
- id str
- The provider-assigned unique ID for this managed resource.
- path str
- Snapshot path
- status str
- Snapshot status
- type str
- Snapshot type
Look up Existing StorageEfsShareSnapshot Resource
Get an existing StorageEfsShareSnapshot 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?: StorageEfsShareSnapshotState, opts?: CustomResourceOptions): StorageEfsShareSnapshot
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
path: Optional[str] = None,
service_name: Optional[str] = None,
share_id: Optional[str] = None,
status: Optional[str] = None,
type: Optional[str] = None) -> StorageEfsShareSnapshot
func GetStorageEfsShareSnapshot(ctx *Context, name string, id IDInput, state *StorageEfsShareSnapshotState, opts ...ResourceOption) (*StorageEfsShareSnapshot, error)
public static StorageEfsShareSnapshot Get(string name, Input<string> id, StorageEfsShareSnapshotState? state, CustomResourceOptions? opts = null)
public static StorageEfsShareSnapshot get(String name, Output<String> id, StorageEfsShareSnapshotState state, CustomResourceOptions options)
resources: _: type: ovh:StorageEfsShareSnapshot 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.
- Created
At string - Snapshot creation date
- Description string
- Snapshot description
- Name string
- Snapshot name
- Path string
- Snapshot path
- Service
Name string - Service name
- string
- Share ID
- Status string
- Snapshot status
- Type string
- Snapshot type
- Created
At string - Snapshot creation date
- Description string
- Snapshot description
- Name string
- Snapshot name
- Path string
- Snapshot path
- Service
Name string - Service name
- string
- Share ID
- Status string
- Snapshot status
- Type string
- Snapshot type
- created
At String - Snapshot creation date
- description String
- Snapshot description
- name String
- Snapshot name
- path String
- Snapshot path
- service
Name String - Service name
- String
- Share ID
- status String
- Snapshot status
- type String
- Snapshot type
- created
At string - Snapshot creation date
- description string
- Snapshot description
- name string
- Snapshot name
- path string
- Snapshot path
- service
Name string - Service name
- string
- Share ID
- status string
- Snapshot status
- type string
- Snapshot type
- created_
at str - Snapshot creation date
- description str
- Snapshot description
- name str
- Snapshot name
- path str
- Snapshot path
- service_
name str - Service name
- str
- Share ID
- status str
- Snapshot status
- type str
- Snapshot type
- created
At String - Snapshot creation date
- description String
- Snapshot description
- name String
- Snapshot name
- path String
- Snapshot path
- service
Name String - Service name
- String
- Share ID
- status String
- Snapshot status
- type String
- Snapshot type
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovh
Terraform Provider.