github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/neptune/clusterSnapshot.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 neptune 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 // Manages a Neptune database cluster snapshot. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/neptune" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := neptune.NewClusterSnapshot(ctx, "example", &neptune.ClusterSnapshotArgs{ 33 // DbClusterIdentifier: pulumi.Any(exampleAwsNeptuneCluster.Id), 34 // DbClusterSnapshotIdentifier: pulumi.String("resourcetestsnapshot1234"), 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 // 46 // ## Import 47 // 48 // Using `pulumi import`, import `aws_neptune_cluster_snapshot` using the cluster snapshot identifier. For example: 49 // 50 // ```sh 51 // $ pulumi import aws:neptune/clusterSnapshot:ClusterSnapshot example my-cluster-snapshot 52 // ``` 53 type ClusterSnapshot struct { 54 pulumi.CustomResourceState 55 56 // Specifies the allocated storage size in gigabytes (GB). 57 AllocatedStorage pulumi.IntOutput `pulumi:"allocatedStorage"` 58 // List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in. 59 AvailabilityZones pulumi.StringArrayOutput `pulumi:"availabilityZones"` 60 // The DB Cluster Identifier from which to take the snapshot. 61 DbClusterIdentifier pulumi.StringOutput `pulumi:"dbClusterIdentifier"` 62 // The Amazon Resource Name (ARN) for the DB Cluster Snapshot. 63 DbClusterSnapshotArn pulumi.StringOutput `pulumi:"dbClusterSnapshotArn"` 64 // The Identifier for the snapshot. 65 DbClusterSnapshotIdentifier pulumi.StringOutput `pulumi:"dbClusterSnapshotIdentifier"` 66 // Specifies the name of the database engine. 67 Engine pulumi.StringOutput `pulumi:"engine"` 68 // Version of the database engine for this DB cluster snapshot. 69 EngineVersion pulumi.StringOutput `pulumi:"engineVersion"` 70 // If storageEncrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot. 71 KmsKeyId pulumi.StringOutput `pulumi:"kmsKeyId"` 72 // License model information for the restored DB cluster. 73 LicenseModel pulumi.StringOutput `pulumi:"licenseModel"` 74 // Port that the DB cluster was listening on at the time of the snapshot. 75 Port pulumi.IntOutput `pulumi:"port"` 76 SnapshotType pulumi.StringOutput `pulumi:"snapshotType"` 77 SourceDbClusterSnapshotArn pulumi.StringOutput `pulumi:"sourceDbClusterSnapshotArn"` 78 // The status of this DB Cluster Snapshot. 79 Status pulumi.StringOutput `pulumi:"status"` 80 // Specifies whether the DB cluster snapshot is encrypted. 81 StorageEncrypted pulumi.BoolOutput `pulumi:"storageEncrypted"` 82 // The VPC ID associated with the DB cluster snapshot. 83 VpcId pulumi.StringOutput `pulumi:"vpcId"` 84 } 85 86 // NewClusterSnapshot registers a new resource with the given unique name, arguments, and options. 87 func NewClusterSnapshot(ctx *pulumi.Context, 88 name string, args *ClusterSnapshotArgs, opts ...pulumi.ResourceOption) (*ClusterSnapshot, error) { 89 if args == nil { 90 return nil, errors.New("missing one or more required arguments") 91 } 92 93 if args.DbClusterIdentifier == nil { 94 return nil, errors.New("invalid value for required argument 'DbClusterIdentifier'") 95 } 96 if args.DbClusterSnapshotIdentifier == nil { 97 return nil, errors.New("invalid value for required argument 'DbClusterSnapshotIdentifier'") 98 } 99 opts = internal.PkgResourceDefaultOpts(opts) 100 var resource ClusterSnapshot 101 err := ctx.RegisterResource("aws:neptune/clusterSnapshot:ClusterSnapshot", name, args, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // GetClusterSnapshot gets an existing ClusterSnapshot resource's state with the given name, ID, and optional 109 // state properties that are used to uniquely qualify the lookup (nil if not required). 110 func GetClusterSnapshot(ctx *pulumi.Context, 111 name string, id pulumi.IDInput, state *ClusterSnapshotState, opts ...pulumi.ResourceOption) (*ClusterSnapshot, error) { 112 var resource ClusterSnapshot 113 err := ctx.ReadResource("aws:neptune/clusterSnapshot:ClusterSnapshot", name, id, state, &resource, opts...) 114 if err != nil { 115 return nil, err 116 } 117 return &resource, nil 118 } 119 120 // Input properties used for looking up and filtering ClusterSnapshot resources. 121 type clusterSnapshotState struct { 122 // Specifies the allocated storage size in gigabytes (GB). 123 AllocatedStorage *int `pulumi:"allocatedStorage"` 124 // List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in. 125 AvailabilityZones []string `pulumi:"availabilityZones"` 126 // The DB Cluster Identifier from which to take the snapshot. 127 DbClusterIdentifier *string `pulumi:"dbClusterIdentifier"` 128 // The Amazon Resource Name (ARN) for the DB Cluster Snapshot. 129 DbClusterSnapshotArn *string `pulumi:"dbClusterSnapshotArn"` 130 // The Identifier for the snapshot. 131 DbClusterSnapshotIdentifier *string `pulumi:"dbClusterSnapshotIdentifier"` 132 // Specifies the name of the database engine. 133 Engine *string `pulumi:"engine"` 134 // Version of the database engine for this DB cluster snapshot. 135 EngineVersion *string `pulumi:"engineVersion"` 136 // If storageEncrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot. 137 KmsKeyId *string `pulumi:"kmsKeyId"` 138 // License model information for the restored DB cluster. 139 LicenseModel *string `pulumi:"licenseModel"` 140 // Port that the DB cluster was listening on at the time of the snapshot. 141 Port *int `pulumi:"port"` 142 SnapshotType *string `pulumi:"snapshotType"` 143 SourceDbClusterSnapshotArn *string `pulumi:"sourceDbClusterSnapshotArn"` 144 // The status of this DB Cluster Snapshot. 145 Status *string `pulumi:"status"` 146 // Specifies whether the DB cluster snapshot is encrypted. 147 StorageEncrypted *bool `pulumi:"storageEncrypted"` 148 // The VPC ID associated with the DB cluster snapshot. 149 VpcId *string `pulumi:"vpcId"` 150 } 151 152 type ClusterSnapshotState struct { 153 // Specifies the allocated storage size in gigabytes (GB). 154 AllocatedStorage pulumi.IntPtrInput 155 // List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in. 156 AvailabilityZones pulumi.StringArrayInput 157 // The DB Cluster Identifier from which to take the snapshot. 158 DbClusterIdentifier pulumi.StringPtrInput 159 // The Amazon Resource Name (ARN) for the DB Cluster Snapshot. 160 DbClusterSnapshotArn pulumi.StringPtrInput 161 // The Identifier for the snapshot. 162 DbClusterSnapshotIdentifier pulumi.StringPtrInput 163 // Specifies the name of the database engine. 164 Engine pulumi.StringPtrInput 165 // Version of the database engine for this DB cluster snapshot. 166 EngineVersion pulumi.StringPtrInput 167 // If storageEncrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot. 168 KmsKeyId pulumi.StringPtrInput 169 // License model information for the restored DB cluster. 170 LicenseModel pulumi.StringPtrInput 171 // Port that the DB cluster was listening on at the time of the snapshot. 172 Port pulumi.IntPtrInput 173 SnapshotType pulumi.StringPtrInput 174 SourceDbClusterSnapshotArn pulumi.StringPtrInput 175 // The status of this DB Cluster Snapshot. 176 Status pulumi.StringPtrInput 177 // Specifies whether the DB cluster snapshot is encrypted. 178 StorageEncrypted pulumi.BoolPtrInput 179 // The VPC ID associated with the DB cluster snapshot. 180 VpcId pulumi.StringPtrInput 181 } 182 183 func (ClusterSnapshotState) ElementType() reflect.Type { 184 return reflect.TypeOf((*clusterSnapshotState)(nil)).Elem() 185 } 186 187 type clusterSnapshotArgs struct { 188 // The DB Cluster Identifier from which to take the snapshot. 189 DbClusterIdentifier string `pulumi:"dbClusterIdentifier"` 190 // The Identifier for the snapshot. 191 DbClusterSnapshotIdentifier string `pulumi:"dbClusterSnapshotIdentifier"` 192 } 193 194 // The set of arguments for constructing a ClusterSnapshot resource. 195 type ClusterSnapshotArgs struct { 196 // The DB Cluster Identifier from which to take the snapshot. 197 DbClusterIdentifier pulumi.StringInput 198 // The Identifier for the snapshot. 199 DbClusterSnapshotIdentifier pulumi.StringInput 200 } 201 202 func (ClusterSnapshotArgs) ElementType() reflect.Type { 203 return reflect.TypeOf((*clusterSnapshotArgs)(nil)).Elem() 204 } 205 206 type ClusterSnapshotInput interface { 207 pulumi.Input 208 209 ToClusterSnapshotOutput() ClusterSnapshotOutput 210 ToClusterSnapshotOutputWithContext(ctx context.Context) ClusterSnapshotOutput 211 } 212 213 func (*ClusterSnapshot) ElementType() reflect.Type { 214 return reflect.TypeOf((**ClusterSnapshot)(nil)).Elem() 215 } 216 217 func (i *ClusterSnapshot) ToClusterSnapshotOutput() ClusterSnapshotOutput { 218 return i.ToClusterSnapshotOutputWithContext(context.Background()) 219 } 220 221 func (i *ClusterSnapshot) ToClusterSnapshotOutputWithContext(ctx context.Context) ClusterSnapshotOutput { 222 return pulumi.ToOutputWithContext(ctx, i).(ClusterSnapshotOutput) 223 } 224 225 // ClusterSnapshotArrayInput is an input type that accepts ClusterSnapshotArray and ClusterSnapshotArrayOutput values. 226 // You can construct a concrete instance of `ClusterSnapshotArrayInput` via: 227 // 228 // ClusterSnapshotArray{ ClusterSnapshotArgs{...} } 229 type ClusterSnapshotArrayInput interface { 230 pulumi.Input 231 232 ToClusterSnapshotArrayOutput() ClusterSnapshotArrayOutput 233 ToClusterSnapshotArrayOutputWithContext(context.Context) ClusterSnapshotArrayOutput 234 } 235 236 type ClusterSnapshotArray []ClusterSnapshotInput 237 238 func (ClusterSnapshotArray) ElementType() reflect.Type { 239 return reflect.TypeOf((*[]*ClusterSnapshot)(nil)).Elem() 240 } 241 242 func (i ClusterSnapshotArray) ToClusterSnapshotArrayOutput() ClusterSnapshotArrayOutput { 243 return i.ToClusterSnapshotArrayOutputWithContext(context.Background()) 244 } 245 246 func (i ClusterSnapshotArray) ToClusterSnapshotArrayOutputWithContext(ctx context.Context) ClusterSnapshotArrayOutput { 247 return pulumi.ToOutputWithContext(ctx, i).(ClusterSnapshotArrayOutput) 248 } 249 250 // ClusterSnapshotMapInput is an input type that accepts ClusterSnapshotMap and ClusterSnapshotMapOutput values. 251 // You can construct a concrete instance of `ClusterSnapshotMapInput` via: 252 // 253 // ClusterSnapshotMap{ "key": ClusterSnapshotArgs{...} } 254 type ClusterSnapshotMapInput interface { 255 pulumi.Input 256 257 ToClusterSnapshotMapOutput() ClusterSnapshotMapOutput 258 ToClusterSnapshotMapOutputWithContext(context.Context) ClusterSnapshotMapOutput 259 } 260 261 type ClusterSnapshotMap map[string]ClusterSnapshotInput 262 263 func (ClusterSnapshotMap) ElementType() reflect.Type { 264 return reflect.TypeOf((*map[string]*ClusterSnapshot)(nil)).Elem() 265 } 266 267 func (i ClusterSnapshotMap) ToClusterSnapshotMapOutput() ClusterSnapshotMapOutput { 268 return i.ToClusterSnapshotMapOutputWithContext(context.Background()) 269 } 270 271 func (i ClusterSnapshotMap) ToClusterSnapshotMapOutputWithContext(ctx context.Context) ClusterSnapshotMapOutput { 272 return pulumi.ToOutputWithContext(ctx, i).(ClusterSnapshotMapOutput) 273 } 274 275 type ClusterSnapshotOutput struct{ *pulumi.OutputState } 276 277 func (ClusterSnapshotOutput) ElementType() reflect.Type { 278 return reflect.TypeOf((**ClusterSnapshot)(nil)).Elem() 279 } 280 281 func (o ClusterSnapshotOutput) ToClusterSnapshotOutput() ClusterSnapshotOutput { 282 return o 283 } 284 285 func (o ClusterSnapshotOutput) ToClusterSnapshotOutputWithContext(ctx context.Context) ClusterSnapshotOutput { 286 return o 287 } 288 289 // Specifies the allocated storage size in gigabytes (GB). 290 func (o ClusterSnapshotOutput) AllocatedStorage() pulumi.IntOutput { 291 return o.ApplyT(func(v *ClusterSnapshot) pulumi.IntOutput { return v.AllocatedStorage }).(pulumi.IntOutput) 292 } 293 294 // List of EC2 Availability Zones that instances in the DB cluster snapshot can be restored in. 295 func (o ClusterSnapshotOutput) AvailabilityZones() pulumi.StringArrayOutput { 296 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringArrayOutput { return v.AvailabilityZones }).(pulumi.StringArrayOutput) 297 } 298 299 // The DB Cluster Identifier from which to take the snapshot. 300 func (o ClusterSnapshotOutput) DbClusterIdentifier() pulumi.StringOutput { 301 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.DbClusterIdentifier }).(pulumi.StringOutput) 302 } 303 304 // The Amazon Resource Name (ARN) for the DB Cluster Snapshot. 305 func (o ClusterSnapshotOutput) DbClusterSnapshotArn() pulumi.StringOutput { 306 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.DbClusterSnapshotArn }).(pulumi.StringOutput) 307 } 308 309 // The Identifier for the snapshot. 310 func (o ClusterSnapshotOutput) DbClusterSnapshotIdentifier() pulumi.StringOutput { 311 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.DbClusterSnapshotIdentifier }).(pulumi.StringOutput) 312 } 313 314 // Specifies the name of the database engine. 315 func (o ClusterSnapshotOutput) Engine() pulumi.StringOutput { 316 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.Engine }).(pulumi.StringOutput) 317 } 318 319 // Version of the database engine for this DB cluster snapshot. 320 func (o ClusterSnapshotOutput) EngineVersion() pulumi.StringOutput { 321 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.EngineVersion }).(pulumi.StringOutput) 322 } 323 324 // If storageEncrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot. 325 func (o ClusterSnapshotOutput) KmsKeyId() pulumi.StringOutput { 326 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.KmsKeyId }).(pulumi.StringOutput) 327 } 328 329 // License model information for the restored DB cluster. 330 func (o ClusterSnapshotOutput) LicenseModel() pulumi.StringOutput { 331 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.LicenseModel }).(pulumi.StringOutput) 332 } 333 334 // Port that the DB cluster was listening on at the time of the snapshot. 335 func (o ClusterSnapshotOutput) Port() pulumi.IntOutput { 336 return o.ApplyT(func(v *ClusterSnapshot) pulumi.IntOutput { return v.Port }).(pulumi.IntOutput) 337 } 338 339 func (o ClusterSnapshotOutput) SnapshotType() pulumi.StringOutput { 340 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.SnapshotType }).(pulumi.StringOutput) 341 } 342 343 func (o ClusterSnapshotOutput) SourceDbClusterSnapshotArn() pulumi.StringOutput { 344 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.SourceDbClusterSnapshotArn }).(pulumi.StringOutput) 345 } 346 347 // The status of this DB Cluster Snapshot. 348 func (o ClusterSnapshotOutput) Status() pulumi.StringOutput { 349 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 350 } 351 352 // Specifies whether the DB cluster snapshot is encrypted. 353 func (o ClusterSnapshotOutput) StorageEncrypted() pulumi.BoolOutput { 354 return o.ApplyT(func(v *ClusterSnapshot) pulumi.BoolOutput { return v.StorageEncrypted }).(pulumi.BoolOutput) 355 } 356 357 // The VPC ID associated with the DB cluster snapshot. 358 func (o ClusterSnapshotOutput) VpcId() pulumi.StringOutput { 359 return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput) 360 } 361 362 type ClusterSnapshotArrayOutput struct{ *pulumi.OutputState } 363 364 func (ClusterSnapshotArrayOutput) ElementType() reflect.Type { 365 return reflect.TypeOf((*[]*ClusterSnapshot)(nil)).Elem() 366 } 367 368 func (o ClusterSnapshotArrayOutput) ToClusterSnapshotArrayOutput() ClusterSnapshotArrayOutput { 369 return o 370 } 371 372 func (o ClusterSnapshotArrayOutput) ToClusterSnapshotArrayOutputWithContext(ctx context.Context) ClusterSnapshotArrayOutput { 373 return o 374 } 375 376 func (o ClusterSnapshotArrayOutput) Index(i pulumi.IntInput) ClusterSnapshotOutput { 377 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterSnapshot { 378 return vs[0].([]*ClusterSnapshot)[vs[1].(int)] 379 }).(ClusterSnapshotOutput) 380 } 381 382 type ClusterSnapshotMapOutput struct{ *pulumi.OutputState } 383 384 func (ClusterSnapshotMapOutput) ElementType() reflect.Type { 385 return reflect.TypeOf((*map[string]*ClusterSnapshot)(nil)).Elem() 386 } 387 388 func (o ClusterSnapshotMapOutput) ToClusterSnapshotMapOutput() ClusterSnapshotMapOutput { 389 return o 390 } 391 392 func (o ClusterSnapshotMapOutput) ToClusterSnapshotMapOutputWithContext(ctx context.Context) ClusterSnapshotMapOutput { 393 return o 394 } 395 396 func (o ClusterSnapshotMapOutput) MapIndex(k pulumi.StringInput) ClusterSnapshotOutput { 397 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterSnapshot { 398 return vs[0].(map[string]*ClusterSnapshot)[vs[1].(string)] 399 }).(ClusterSnapshotOutput) 400 } 401 402 func init() { 403 pulumi.RegisterInputType(reflect.TypeOf((*ClusterSnapshotInput)(nil)).Elem(), &ClusterSnapshot{}) 404 pulumi.RegisterInputType(reflect.TypeOf((*ClusterSnapshotArrayInput)(nil)).Elem(), ClusterSnapshotArray{}) 405 pulumi.RegisterInputType(reflect.TypeOf((*ClusterSnapshotMapInput)(nil)).Elem(), ClusterSnapshotMap{}) 406 pulumi.RegisterOutputType(ClusterSnapshotOutput{}) 407 pulumi.RegisterOutputType(ClusterSnapshotArrayOutput{}) 408 pulumi.RegisterOutputType(ClusterSnapshotMapOutput{}) 409 }