github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudhsmv2/getCluster.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package cloudhsmv2 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Use this data source to get information about a CloudHSM v2 cluster 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudhsmv2" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := cloudhsmv2.LookupCluster(ctx, &cloudhsmv2.LookupClusterArgs{ 32 // ClusterId: "cluster-testclusterid", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func LookupCluster(ctx *pulumi.Context, args *LookupClusterArgs, opts ...pulumi.InvokeOption) (*LookupClusterResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv LookupClusterResult 46 err := ctx.Invoke("aws:cloudhsmv2/getCluster:getCluster", args, &rv, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &rv, nil 51 } 52 53 // A collection of arguments for invoking getCluster. 54 type LookupClusterArgs struct { 55 // ID of Cloud HSM v2 cluster. 56 ClusterId string `pulumi:"clusterId"` 57 // State of the cluster to be found. 58 ClusterState *string `pulumi:"clusterState"` 59 } 60 61 // A collection of values returned by getCluster. 62 type LookupClusterResult struct { 63 // The list of cluster certificates. 64 ClusterCertificates []GetClusterClusterCertificate `pulumi:"clusterCertificates"` 65 ClusterId string `pulumi:"clusterId"` 66 ClusterState string `pulumi:"clusterState"` 67 // The provider-assigned unique ID for this managed resource. 68 Id string `pulumi:"id"` 69 // ID of the security group associated with the CloudHSM cluster. 70 SecurityGroupId string `pulumi:"securityGroupId"` 71 // IDs of subnets in which cluster operates. 72 SubnetIds []string `pulumi:"subnetIds"` 73 // ID of the VPC that the CloudHSM cluster resides in. 74 VpcId string `pulumi:"vpcId"` 75 } 76 77 func LookupClusterOutput(ctx *pulumi.Context, args LookupClusterOutputArgs, opts ...pulumi.InvokeOption) LookupClusterResultOutput { 78 return pulumi.ToOutputWithContext(context.Background(), args). 79 ApplyT(func(v interface{}) (LookupClusterResult, error) { 80 args := v.(LookupClusterArgs) 81 r, err := LookupCluster(ctx, &args, opts...) 82 var s LookupClusterResult 83 if r != nil { 84 s = *r 85 } 86 return s, err 87 }).(LookupClusterResultOutput) 88 } 89 90 // A collection of arguments for invoking getCluster. 91 type LookupClusterOutputArgs struct { 92 // ID of Cloud HSM v2 cluster. 93 ClusterId pulumi.StringInput `pulumi:"clusterId"` 94 // State of the cluster to be found. 95 ClusterState pulumi.StringPtrInput `pulumi:"clusterState"` 96 } 97 98 func (LookupClusterOutputArgs) ElementType() reflect.Type { 99 return reflect.TypeOf((*LookupClusterArgs)(nil)).Elem() 100 } 101 102 // A collection of values returned by getCluster. 103 type LookupClusterResultOutput struct{ *pulumi.OutputState } 104 105 func (LookupClusterResultOutput) ElementType() reflect.Type { 106 return reflect.TypeOf((*LookupClusterResult)(nil)).Elem() 107 } 108 109 func (o LookupClusterResultOutput) ToLookupClusterResultOutput() LookupClusterResultOutput { 110 return o 111 } 112 113 func (o LookupClusterResultOutput) ToLookupClusterResultOutputWithContext(ctx context.Context) LookupClusterResultOutput { 114 return o 115 } 116 117 // The list of cluster certificates. 118 func (o LookupClusterResultOutput) ClusterCertificates() GetClusterClusterCertificateArrayOutput { 119 return o.ApplyT(func(v LookupClusterResult) []GetClusterClusterCertificate { return v.ClusterCertificates }).(GetClusterClusterCertificateArrayOutput) 120 } 121 122 func (o LookupClusterResultOutput) ClusterId() pulumi.StringOutput { 123 return o.ApplyT(func(v LookupClusterResult) string { return v.ClusterId }).(pulumi.StringOutput) 124 } 125 126 func (o LookupClusterResultOutput) ClusterState() pulumi.StringOutput { 127 return o.ApplyT(func(v LookupClusterResult) string { return v.ClusterState }).(pulumi.StringOutput) 128 } 129 130 // The provider-assigned unique ID for this managed resource. 131 func (o LookupClusterResultOutput) Id() pulumi.StringOutput { 132 return o.ApplyT(func(v LookupClusterResult) string { return v.Id }).(pulumi.StringOutput) 133 } 134 135 // ID of the security group associated with the CloudHSM cluster. 136 func (o LookupClusterResultOutput) SecurityGroupId() pulumi.StringOutput { 137 return o.ApplyT(func(v LookupClusterResult) string { return v.SecurityGroupId }).(pulumi.StringOutput) 138 } 139 140 // IDs of subnets in which cluster operates. 141 func (o LookupClusterResultOutput) SubnetIds() pulumi.StringArrayOutput { 142 return o.ApplyT(func(v LookupClusterResult) []string { return v.SubnetIds }).(pulumi.StringArrayOutput) 143 } 144 145 // ID of the VPC that the CloudHSM cluster resides in. 146 func (o LookupClusterResultOutput) VpcId() pulumi.StringOutput { 147 return o.ApplyT(func(v LookupClusterResult) string { return v.VpcId }).(pulumi.StringOutput) 148 } 149 150 func init() { 151 pulumi.RegisterOutputType(LookupClusterResultOutput{}) 152 }