AWS Classic

v5.21.1 published on Thursday, Nov 17, 2022 by Pulumi

Cache

Manages an AWS Storage Gateway cache.

NOTE: The Storage Gateway API provides no method to remove a cache disk. Destroying this resource does not perform any Storage Gateway actions.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.StorageGateway.Cache("example", new()
    {
        DiskId = data.Aws_storagegateway_local_disk.Example.Id,
        GatewayArn = aws_storagegateway_gateway.Example.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/storagegateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := storagegateway.NewCache(ctx, "example", &storagegateway.CacheArgs{
			DiskId:     pulumi.Any(data.Aws_storagegateway_local_disk.Example.Id),
			GatewayArn: pulumi.Any(aws_storagegateway_gateway.Example.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.storagegateway.Cache;
import com.pulumi.aws.storagegateway.CacheArgs;
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 example = new Cache("example", CacheArgs.builder()        
            .diskId(data.aws_storagegateway_local_disk().example().id())
            .gatewayArn(aws_storagegateway_gateway.example().arn())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.storagegateway.Cache("example",
    disk_id=data["aws_storagegateway_local_disk"]["example"]["id"],
    gateway_arn=aws_storagegateway_gateway["example"]["arn"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.storagegateway.Cache("example", {
    diskId: data.aws_storagegateway_local_disk.example.id,
    gatewayArn: aws_storagegateway_gateway.example.arn,
});
resources:
  example:
    type: aws:storagegateway:Cache
    properties:
      diskId: ${data.aws_storagegateway_local_disk.example.id}
      gatewayArn: ${aws_storagegateway_gateway.example.arn}

Create Cache Resource

new Cache(name: string, args: CacheArgs, opts?: CustomResourceOptions);
@overload
def Cache(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          disk_id: Optional[str] = None,
          gateway_arn: Optional[str] = None)
@overload
def Cache(resource_name: str,
          args: CacheArgs,
          opts: Optional[ResourceOptions] = None)
func NewCache(ctx *Context, name string, args CacheArgs, opts ...ResourceOption) (*Cache, error)
public Cache(string name, CacheArgs args, CustomResourceOptions? opts = null)
public Cache(String name, CacheArgs args)
public Cache(String name, CacheArgs args, CustomResourceOptions options)
type: aws:storagegateway:Cache
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CacheArgs
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 CacheArgs
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 CacheArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CacheArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CacheArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Cache 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 Cache resource accepts the following input properties:

DiskId string

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

GatewayArn string

The Amazon Resource Name (ARN) of the gateway.

DiskId string

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

GatewayArn string

The Amazon Resource Name (ARN) of the gateway.

diskId String

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

gatewayArn String

The Amazon Resource Name (ARN) of the gateway.

diskId string

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

gatewayArn string

The Amazon Resource Name (ARN) of the gateway.

disk_id str

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

gateway_arn str

The Amazon Resource Name (ARN) of the gateway.

diskId String

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

gatewayArn String

The Amazon Resource Name (ARN) of the gateway.

Outputs

All input properties are implicitly available as output properties. Additionally, the Cache 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 Cache Resource

Get an existing Cache 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?: CacheState, opts?: CustomResourceOptions): Cache
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        disk_id: Optional[str] = None,
        gateway_arn: Optional[str] = None) -> Cache
func GetCache(ctx *Context, name string, id IDInput, state *CacheState, opts ...ResourceOption) (*Cache, error)
public static Cache Get(string name, Input<string> id, CacheState? state, CustomResourceOptions? opts = null)
public static Cache get(String name, Output<String> id, CacheState 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.
The following state arguments are supported:
DiskId string

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

GatewayArn string

The Amazon Resource Name (ARN) of the gateway.

DiskId string

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

GatewayArn string

The Amazon Resource Name (ARN) of the gateway.

diskId String

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

gatewayArn String

The Amazon Resource Name (ARN) of the gateway.

diskId string

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

gatewayArn string

The Amazon Resource Name (ARN) of the gateway.

disk_id str

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

gateway_arn str

The Amazon Resource Name (ARN) of the gateway.

diskId String

Local disk identifier. For example, pci-0000:03:00.0-scsi-0:0:0:0.

gatewayArn String

The Amazon Resource Name (ARN) of the gateway.

Import

aws_storagegateway_cache can be imported by using the gateway Amazon Resource Name (ARN) and local disk identifier separated with a colon (:), e.g.,

 $ pulumi import aws:storagegateway/cache:Cache example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678:pci-0000:03:00.0-scsi-0:0:0:0

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.