github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudhsmv2/cluster.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 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Creates an Amazon CloudHSM v2 cluster. 16 // 17 // For information about CloudHSM v2, see the 18 // [AWS CloudHSM User Guide](https://docs.aws.amazon.com/cloudhsm/latest/userguide/introduction.html) and the [Amazon 19 // CloudHSM API Reference][2]. 20 // 21 // > **NOTE:** A CloudHSM Cluster can take several minutes to set up. 22 // Practically no single attribute can be updated, except for `tags`. 23 // If you need to delete a cluster, you have to remove its HSM modules first. 24 // To initialize cluster, you have to add an HSM instance to the cluster, then sign CSR and upload it. 25 // 26 // ## Import 27 // 28 // Using `pulumi import`, import CloudHSM v2 Clusters using the cluster `id`. For example: 29 // 30 // ```sh 31 // $ pulumi import aws:cloudhsmv2/cluster:Cluster test_cluster cluster-aeb282a201 32 // ``` 33 type Cluster struct { 34 pulumi.CustomResourceState 35 36 // The list of cluster certificates. 37 ClusterCertificates ClusterClusterCertificateArrayOutput `pulumi:"clusterCertificates"` 38 // The id of the CloudHSM cluster. 39 ClusterId pulumi.StringOutput `pulumi:"clusterId"` 40 // The state of the CloudHSM cluster. 41 ClusterState pulumi.StringOutput `pulumi:"clusterState"` 42 // The type of HSM module in the cluster. Currently, only `hsm1.medium` is supported. 43 HsmType pulumi.StringOutput `pulumi:"hsmType"` 44 // The ID of the security group associated with the CloudHSM cluster. 45 SecurityGroupId pulumi.StringOutput `pulumi:"securityGroupId"` 46 // ID of Cloud HSM v2 cluster backup to be restored. 47 SourceBackupIdentifier pulumi.StringPtrOutput `pulumi:"sourceBackupIdentifier"` 48 // The IDs of subnets in which cluster will operate. 49 SubnetIds pulumi.StringArrayOutput `pulumi:"subnetIds"` 50 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 51 Tags pulumi.StringMapOutput `pulumi:"tags"` 52 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 53 // 54 // Deprecated: Please use `tags` instead. 55 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 56 // The id of the VPC that the CloudHSM cluster resides in. 57 VpcId pulumi.StringOutput `pulumi:"vpcId"` 58 } 59 60 // NewCluster registers a new resource with the given unique name, arguments, and options. 61 func NewCluster(ctx *pulumi.Context, 62 name string, args *ClusterArgs, opts ...pulumi.ResourceOption) (*Cluster, error) { 63 if args == nil { 64 return nil, errors.New("missing one or more required arguments") 65 } 66 67 if args.HsmType == nil { 68 return nil, errors.New("invalid value for required argument 'HsmType'") 69 } 70 if args.SubnetIds == nil { 71 return nil, errors.New("invalid value for required argument 'SubnetIds'") 72 } 73 opts = internal.PkgResourceDefaultOpts(opts) 74 var resource Cluster 75 err := ctx.RegisterResource("aws:cloudhsmv2/cluster:Cluster", name, args, &resource, opts...) 76 if err != nil { 77 return nil, err 78 } 79 return &resource, nil 80 } 81 82 // GetCluster gets an existing Cluster resource's state with the given name, ID, and optional 83 // state properties that are used to uniquely qualify the lookup (nil if not required). 84 func GetCluster(ctx *pulumi.Context, 85 name string, id pulumi.IDInput, state *ClusterState, opts ...pulumi.ResourceOption) (*Cluster, error) { 86 var resource Cluster 87 err := ctx.ReadResource("aws:cloudhsmv2/cluster:Cluster", name, id, state, &resource, opts...) 88 if err != nil { 89 return nil, err 90 } 91 return &resource, nil 92 } 93 94 // Input properties used for looking up and filtering Cluster resources. 95 type clusterState struct { 96 // The list of cluster certificates. 97 ClusterCertificates []ClusterClusterCertificate `pulumi:"clusterCertificates"` 98 // The id of the CloudHSM cluster. 99 ClusterId *string `pulumi:"clusterId"` 100 // The state of the CloudHSM cluster. 101 ClusterState *string `pulumi:"clusterState"` 102 // The type of HSM module in the cluster. Currently, only `hsm1.medium` is supported. 103 HsmType *string `pulumi:"hsmType"` 104 // The ID of the security group associated with the CloudHSM cluster. 105 SecurityGroupId *string `pulumi:"securityGroupId"` 106 // ID of Cloud HSM v2 cluster backup to be restored. 107 SourceBackupIdentifier *string `pulumi:"sourceBackupIdentifier"` 108 // The IDs of subnets in which cluster will operate. 109 SubnetIds []string `pulumi:"subnetIds"` 110 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 111 Tags map[string]string `pulumi:"tags"` 112 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 113 // 114 // Deprecated: Please use `tags` instead. 115 TagsAll map[string]string `pulumi:"tagsAll"` 116 // The id of the VPC that the CloudHSM cluster resides in. 117 VpcId *string `pulumi:"vpcId"` 118 } 119 120 type ClusterState struct { 121 // The list of cluster certificates. 122 ClusterCertificates ClusterClusterCertificateArrayInput 123 // The id of the CloudHSM cluster. 124 ClusterId pulumi.StringPtrInput 125 // The state of the CloudHSM cluster. 126 ClusterState pulumi.StringPtrInput 127 // The type of HSM module in the cluster. Currently, only `hsm1.medium` is supported. 128 HsmType pulumi.StringPtrInput 129 // The ID of the security group associated with the CloudHSM cluster. 130 SecurityGroupId pulumi.StringPtrInput 131 // ID of Cloud HSM v2 cluster backup to be restored. 132 SourceBackupIdentifier pulumi.StringPtrInput 133 // The IDs of subnets in which cluster will operate. 134 SubnetIds pulumi.StringArrayInput 135 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 136 Tags pulumi.StringMapInput 137 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 138 // 139 // Deprecated: Please use `tags` instead. 140 TagsAll pulumi.StringMapInput 141 // The id of the VPC that the CloudHSM cluster resides in. 142 VpcId pulumi.StringPtrInput 143 } 144 145 func (ClusterState) ElementType() reflect.Type { 146 return reflect.TypeOf((*clusterState)(nil)).Elem() 147 } 148 149 type clusterArgs struct { 150 // The type of HSM module in the cluster. Currently, only `hsm1.medium` is supported. 151 HsmType string `pulumi:"hsmType"` 152 // ID of Cloud HSM v2 cluster backup to be restored. 153 SourceBackupIdentifier *string `pulumi:"sourceBackupIdentifier"` 154 // The IDs of subnets in which cluster will operate. 155 SubnetIds []string `pulumi:"subnetIds"` 156 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 157 Tags map[string]string `pulumi:"tags"` 158 } 159 160 // The set of arguments for constructing a Cluster resource. 161 type ClusterArgs struct { 162 // The type of HSM module in the cluster. Currently, only `hsm1.medium` is supported. 163 HsmType pulumi.StringInput 164 // ID of Cloud HSM v2 cluster backup to be restored. 165 SourceBackupIdentifier pulumi.StringPtrInput 166 // The IDs of subnets in which cluster will operate. 167 SubnetIds pulumi.StringArrayInput 168 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 169 Tags pulumi.StringMapInput 170 } 171 172 func (ClusterArgs) ElementType() reflect.Type { 173 return reflect.TypeOf((*clusterArgs)(nil)).Elem() 174 } 175 176 type ClusterInput interface { 177 pulumi.Input 178 179 ToClusterOutput() ClusterOutput 180 ToClusterOutputWithContext(ctx context.Context) ClusterOutput 181 } 182 183 func (*Cluster) ElementType() reflect.Type { 184 return reflect.TypeOf((**Cluster)(nil)).Elem() 185 } 186 187 func (i *Cluster) ToClusterOutput() ClusterOutput { 188 return i.ToClusterOutputWithContext(context.Background()) 189 } 190 191 func (i *Cluster) ToClusterOutputWithContext(ctx context.Context) ClusterOutput { 192 return pulumi.ToOutputWithContext(ctx, i).(ClusterOutput) 193 } 194 195 // ClusterArrayInput is an input type that accepts ClusterArray and ClusterArrayOutput values. 196 // You can construct a concrete instance of `ClusterArrayInput` via: 197 // 198 // ClusterArray{ ClusterArgs{...} } 199 type ClusterArrayInput interface { 200 pulumi.Input 201 202 ToClusterArrayOutput() ClusterArrayOutput 203 ToClusterArrayOutputWithContext(context.Context) ClusterArrayOutput 204 } 205 206 type ClusterArray []ClusterInput 207 208 func (ClusterArray) ElementType() reflect.Type { 209 return reflect.TypeOf((*[]*Cluster)(nil)).Elem() 210 } 211 212 func (i ClusterArray) ToClusterArrayOutput() ClusterArrayOutput { 213 return i.ToClusterArrayOutputWithContext(context.Background()) 214 } 215 216 func (i ClusterArray) ToClusterArrayOutputWithContext(ctx context.Context) ClusterArrayOutput { 217 return pulumi.ToOutputWithContext(ctx, i).(ClusterArrayOutput) 218 } 219 220 // ClusterMapInput is an input type that accepts ClusterMap and ClusterMapOutput values. 221 // You can construct a concrete instance of `ClusterMapInput` via: 222 // 223 // ClusterMap{ "key": ClusterArgs{...} } 224 type ClusterMapInput interface { 225 pulumi.Input 226 227 ToClusterMapOutput() ClusterMapOutput 228 ToClusterMapOutputWithContext(context.Context) ClusterMapOutput 229 } 230 231 type ClusterMap map[string]ClusterInput 232 233 func (ClusterMap) ElementType() reflect.Type { 234 return reflect.TypeOf((*map[string]*Cluster)(nil)).Elem() 235 } 236 237 func (i ClusterMap) ToClusterMapOutput() ClusterMapOutput { 238 return i.ToClusterMapOutputWithContext(context.Background()) 239 } 240 241 func (i ClusterMap) ToClusterMapOutputWithContext(ctx context.Context) ClusterMapOutput { 242 return pulumi.ToOutputWithContext(ctx, i).(ClusterMapOutput) 243 } 244 245 type ClusterOutput struct{ *pulumi.OutputState } 246 247 func (ClusterOutput) ElementType() reflect.Type { 248 return reflect.TypeOf((**Cluster)(nil)).Elem() 249 } 250 251 func (o ClusterOutput) ToClusterOutput() ClusterOutput { 252 return o 253 } 254 255 func (o ClusterOutput) ToClusterOutputWithContext(ctx context.Context) ClusterOutput { 256 return o 257 } 258 259 // The list of cluster certificates. 260 func (o ClusterOutput) ClusterCertificates() ClusterClusterCertificateArrayOutput { 261 return o.ApplyT(func(v *Cluster) ClusterClusterCertificateArrayOutput { return v.ClusterCertificates }).(ClusterClusterCertificateArrayOutput) 262 } 263 264 // The id of the CloudHSM cluster. 265 func (o ClusterOutput) ClusterId() pulumi.StringOutput { 266 return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput) 267 } 268 269 // The state of the CloudHSM cluster. 270 func (o ClusterOutput) ClusterState() pulumi.StringOutput { 271 return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.ClusterState }).(pulumi.StringOutput) 272 } 273 274 // The type of HSM module in the cluster. Currently, only `hsm1.medium` is supported. 275 func (o ClusterOutput) HsmType() pulumi.StringOutput { 276 return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.HsmType }).(pulumi.StringOutput) 277 } 278 279 // The ID of the security group associated with the CloudHSM cluster. 280 func (o ClusterOutput) SecurityGroupId() pulumi.StringOutput { 281 return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.SecurityGroupId }).(pulumi.StringOutput) 282 } 283 284 // ID of Cloud HSM v2 cluster backup to be restored. 285 func (o ClusterOutput) SourceBackupIdentifier() pulumi.StringPtrOutput { 286 return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.SourceBackupIdentifier }).(pulumi.StringPtrOutput) 287 } 288 289 // The IDs of subnets in which cluster will operate. 290 func (o ClusterOutput) SubnetIds() pulumi.StringArrayOutput { 291 return o.ApplyT(func(v *Cluster) pulumi.StringArrayOutput { return v.SubnetIds }).(pulumi.StringArrayOutput) 292 } 293 294 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 295 func (o ClusterOutput) Tags() pulumi.StringMapOutput { 296 return o.ApplyT(func(v *Cluster) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 297 } 298 299 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 300 // 301 // Deprecated: Please use `tags` instead. 302 func (o ClusterOutput) TagsAll() pulumi.StringMapOutput { 303 return o.ApplyT(func(v *Cluster) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 304 } 305 306 // The id of the VPC that the CloudHSM cluster resides in. 307 func (o ClusterOutput) VpcId() pulumi.StringOutput { 308 return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput) 309 } 310 311 type ClusterArrayOutput struct{ *pulumi.OutputState } 312 313 func (ClusterArrayOutput) ElementType() reflect.Type { 314 return reflect.TypeOf((*[]*Cluster)(nil)).Elem() 315 } 316 317 func (o ClusterArrayOutput) ToClusterArrayOutput() ClusterArrayOutput { 318 return o 319 } 320 321 func (o ClusterArrayOutput) ToClusterArrayOutputWithContext(ctx context.Context) ClusterArrayOutput { 322 return o 323 } 324 325 func (o ClusterArrayOutput) Index(i pulumi.IntInput) ClusterOutput { 326 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Cluster { 327 return vs[0].([]*Cluster)[vs[1].(int)] 328 }).(ClusterOutput) 329 } 330 331 type ClusterMapOutput struct{ *pulumi.OutputState } 332 333 func (ClusterMapOutput) ElementType() reflect.Type { 334 return reflect.TypeOf((*map[string]*Cluster)(nil)).Elem() 335 } 336 337 func (o ClusterMapOutput) ToClusterMapOutput() ClusterMapOutput { 338 return o 339 } 340 341 func (o ClusterMapOutput) ToClusterMapOutputWithContext(ctx context.Context) ClusterMapOutput { 342 return o 343 } 344 345 func (o ClusterMapOutput) MapIndex(k pulumi.StringInput) ClusterOutput { 346 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Cluster { 347 return vs[0].(map[string]*Cluster)[vs[1].(string)] 348 }).(ClusterOutput) 349 } 350 351 func init() { 352 pulumi.RegisterInputType(reflect.TypeOf((*ClusterInput)(nil)).Elem(), &Cluster{}) 353 pulumi.RegisterInputType(reflect.TypeOf((*ClusterArrayInput)(nil)).Elem(), ClusterArray{}) 354 pulumi.RegisterInputType(reflect.TypeOf((*ClusterMapInput)(nil)).Elem(), ClusterMap{}) 355 pulumi.RegisterOutputType(ClusterOutput{}) 356 pulumi.RegisterOutputType(ClusterArrayOutput{}) 357 pulumi.RegisterOutputType(ClusterMapOutput{}) 358 }