getOpenZfsSnapshot function

Future<GetOpenZfsSnapshotResult> getOpenZfsSnapshot(
  1. GetOpenZfsSnapshotArgs args, {
  2. InvokeOptions? options,
})

Use this data source to get information about an Amazon FSx for OpenZFS Snapshot for use when provisioning new Volumes.

Example Usage

Root volume Example

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.fsx.getOpenZfsSnapshot({
    filters: [{
        name: "volume-id",
        values: ["fsvol-073a32b6098a73feb"],
    }],
    mostRecent: true,
});
import pulumi
import pulumi_aws as aws

example = aws.fsx.get_open_zfs_snapshot(filters=[{
        "name": "volume-id",
        "values": ["fsvol-073a32b6098a73feb"],
    }],
    most_recent=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = Aws.Fsx.GetOpenZfsSnapshot.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Fsx.Inputs.GetOpenZfsSnapshotFilterInputArgs
            {
                Name = "volume-id",
                Values = new[]
                {
                    "fsvol-073a32b6098a73feb",
                },
            },
        },
        MostRecent = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/fsx"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := fsx.LookupOpenZfsSnapshot(ctx, &fsx.LookupOpenZfsSnapshotArgs{
			Filters: []fsx.GetOpenZfsSnapshotFilter{
				{
					Name: "volume-id",
					Values: []string{
						"fsvol-073a32b6098a73feb",
					},
				},
			},
			MostRecent: pulumi.BoolRef(true),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_fsx_getopenzfssnapshot" "example" {
  filters {
    name   = "volume-id"
    values = ["fsvol-073a32b6098a73feb"]
  }
  most_recent = true
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.fsx.FsxFunctions;
import com.pulumi.aws.fsx.inputs.GetOpenZfsSnapshotArgs;
import com.pulumi.aws.fsx.inputs.GetOpenZfsSnapshotFilterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = FsxFunctions.getOpenZfsSnapshot(GetOpenZfsSnapshotArgs.builder()
            .filters(GetOpenZfsSnapshotFilterArgs.builder()
                .name("volume-id")
                .values("fsvol-073a32b6098a73feb")
                .build())
            .mostRecent(true)
            .build());

    }
}
variables:
  example:
    fn::invoke:
      function: aws:fsx:getOpenZfsSnapshot
      arguments:
        filters:
          - name: volume-id
            values:
              - fsvol-073a32b6098a73feb
        mostRecent: true

args Arguments passed to this invoke. Arguments for getOpenZfsSnapshot. options Invoke options controlling this call.

Implementation

Future<GetOpenZfsSnapshotResult> getOpenZfsSnapshot(
  GetOpenZfsSnapshotArgs args, {
  pulumi.InvokeOptions? options,
}) async {
  final deployment = pulumi.Deployment.instance;
  final result = await deployment.invoke<Map<String, dynamic>>(
    'aws:fsx/getOpenZfsSnapshot:getOpenZfsSnapshot',
    args.toMap(),
    options: pulumi.toDeploymentInvokeOptions(options),
  );
  return GetOpenZfsSnapshotResult.fromMap(result);
}