github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/backup/vaultLockConfiguration.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 backup 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 // Provides an AWS Backup vault lock configuration resource. 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/backup" 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 := backup.NewVaultLockConfiguration(ctx, "test", &backup.VaultLockConfigurationArgs{ 33 // BackupVaultName: pulumi.String("example_backup_vault"), 34 // ChangeableForDays: pulumi.Int(3), 35 // MaxRetentionDays: pulumi.Int(1200), 36 // MinRetentionDays: pulumi.Int(7), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import Backup vault lock configuration using the `name`. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:backup/vaultLockConfiguration:VaultLockConfiguration test TestVault 54 // ``` 55 type VaultLockConfiguration struct { 56 pulumi.CustomResourceState 57 58 // The ARN of the vault. 59 BackupVaultArn pulumi.StringOutput `pulumi:"backupVaultArn"` 60 // Name of the backup vault to add a lock configuration for. 61 BackupVaultName pulumi.StringOutput `pulumi:"backupVaultName"` 62 // The number of days before the lock date. If omitted creates a vault lock in `governance` mode, otherwise it will create a vault lock in `compliance` mode. 63 ChangeableForDays pulumi.IntPtrOutput `pulumi:"changeableForDays"` 64 // The maximum retention period that the vault retains its recovery points. 65 MaxRetentionDays pulumi.IntPtrOutput `pulumi:"maxRetentionDays"` 66 // The minimum retention period that the vault retains its recovery points. 67 MinRetentionDays pulumi.IntPtrOutput `pulumi:"minRetentionDays"` 68 } 69 70 // NewVaultLockConfiguration registers a new resource with the given unique name, arguments, and options. 71 func NewVaultLockConfiguration(ctx *pulumi.Context, 72 name string, args *VaultLockConfigurationArgs, opts ...pulumi.ResourceOption) (*VaultLockConfiguration, error) { 73 if args == nil { 74 return nil, errors.New("missing one or more required arguments") 75 } 76 77 if args.BackupVaultName == nil { 78 return nil, errors.New("invalid value for required argument 'BackupVaultName'") 79 } 80 opts = internal.PkgResourceDefaultOpts(opts) 81 var resource VaultLockConfiguration 82 err := ctx.RegisterResource("aws:backup/vaultLockConfiguration:VaultLockConfiguration", name, args, &resource, opts...) 83 if err != nil { 84 return nil, err 85 } 86 return &resource, nil 87 } 88 89 // GetVaultLockConfiguration gets an existing VaultLockConfiguration resource's state with the given name, ID, and optional 90 // state properties that are used to uniquely qualify the lookup (nil if not required). 91 func GetVaultLockConfiguration(ctx *pulumi.Context, 92 name string, id pulumi.IDInput, state *VaultLockConfigurationState, opts ...pulumi.ResourceOption) (*VaultLockConfiguration, error) { 93 var resource VaultLockConfiguration 94 err := ctx.ReadResource("aws:backup/vaultLockConfiguration:VaultLockConfiguration", name, id, state, &resource, opts...) 95 if err != nil { 96 return nil, err 97 } 98 return &resource, nil 99 } 100 101 // Input properties used for looking up and filtering VaultLockConfiguration resources. 102 type vaultLockConfigurationState struct { 103 // The ARN of the vault. 104 BackupVaultArn *string `pulumi:"backupVaultArn"` 105 // Name of the backup vault to add a lock configuration for. 106 BackupVaultName *string `pulumi:"backupVaultName"` 107 // The number of days before the lock date. If omitted creates a vault lock in `governance` mode, otherwise it will create a vault lock in `compliance` mode. 108 ChangeableForDays *int `pulumi:"changeableForDays"` 109 // The maximum retention period that the vault retains its recovery points. 110 MaxRetentionDays *int `pulumi:"maxRetentionDays"` 111 // The minimum retention period that the vault retains its recovery points. 112 MinRetentionDays *int `pulumi:"minRetentionDays"` 113 } 114 115 type VaultLockConfigurationState struct { 116 // The ARN of the vault. 117 BackupVaultArn pulumi.StringPtrInput 118 // Name of the backup vault to add a lock configuration for. 119 BackupVaultName pulumi.StringPtrInput 120 // The number of days before the lock date. If omitted creates a vault lock in `governance` mode, otherwise it will create a vault lock in `compliance` mode. 121 ChangeableForDays pulumi.IntPtrInput 122 // The maximum retention period that the vault retains its recovery points. 123 MaxRetentionDays pulumi.IntPtrInput 124 // The minimum retention period that the vault retains its recovery points. 125 MinRetentionDays pulumi.IntPtrInput 126 } 127 128 func (VaultLockConfigurationState) ElementType() reflect.Type { 129 return reflect.TypeOf((*vaultLockConfigurationState)(nil)).Elem() 130 } 131 132 type vaultLockConfigurationArgs struct { 133 // Name of the backup vault to add a lock configuration for. 134 BackupVaultName string `pulumi:"backupVaultName"` 135 // The number of days before the lock date. If omitted creates a vault lock in `governance` mode, otherwise it will create a vault lock in `compliance` mode. 136 ChangeableForDays *int `pulumi:"changeableForDays"` 137 // The maximum retention period that the vault retains its recovery points. 138 MaxRetentionDays *int `pulumi:"maxRetentionDays"` 139 // The minimum retention period that the vault retains its recovery points. 140 MinRetentionDays *int `pulumi:"minRetentionDays"` 141 } 142 143 // The set of arguments for constructing a VaultLockConfiguration resource. 144 type VaultLockConfigurationArgs struct { 145 // Name of the backup vault to add a lock configuration for. 146 BackupVaultName pulumi.StringInput 147 // The number of days before the lock date. If omitted creates a vault lock in `governance` mode, otherwise it will create a vault lock in `compliance` mode. 148 ChangeableForDays pulumi.IntPtrInput 149 // The maximum retention period that the vault retains its recovery points. 150 MaxRetentionDays pulumi.IntPtrInput 151 // The minimum retention period that the vault retains its recovery points. 152 MinRetentionDays pulumi.IntPtrInput 153 } 154 155 func (VaultLockConfigurationArgs) ElementType() reflect.Type { 156 return reflect.TypeOf((*vaultLockConfigurationArgs)(nil)).Elem() 157 } 158 159 type VaultLockConfigurationInput interface { 160 pulumi.Input 161 162 ToVaultLockConfigurationOutput() VaultLockConfigurationOutput 163 ToVaultLockConfigurationOutputWithContext(ctx context.Context) VaultLockConfigurationOutput 164 } 165 166 func (*VaultLockConfiguration) ElementType() reflect.Type { 167 return reflect.TypeOf((**VaultLockConfiguration)(nil)).Elem() 168 } 169 170 func (i *VaultLockConfiguration) ToVaultLockConfigurationOutput() VaultLockConfigurationOutput { 171 return i.ToVaultLockConfigurationOutputWithContext(context.Background()) 172 } 173 174 func (i *VaultLockConfiguration) ToVaultLockConfigurationOutputWithContext(ctx context.Context) VaultLockConfigurationOutput { 175 return pulumi.ToOutputWithContext(ctx, i).(VaultLockConfigurationOutput) 176 } 177 178 // VaultLockConfigurationArrayInput is an input type that accepts VaultLockConfigurationArray and VaultLockConfigurationArrayOutput values. 179 // You can construct a concrete instance of `VaultLockConfigurationArrayInput` via: 180 // 181 // VaultLockConfigurationArray{ VaultLockConfigurationArgs{...} } 182 type VaultLockConfigurationArrayInput interface { 183 pulumi.Input 184 185 ToVaultLockConfigurationArrayOutput() VaultLockConfigurationArrayOutput 186 ToVaultLockConfigurationArrayOutputWithContext(context.Context) VaultLockConfigurationArrayOutput 187 } 188 189 type VaultLockConfigurationArray []VaultLockConfigurationInput 190 191 func (VaultLockConfigurationArray) ElementType() reflect.Type { 192 return reflect.TypeOf((*[]*VaultLockConfiguration)(nil)).Elem() 193 } 194 195 func (i VaultLockConfigurationArray) ToVaultLockConfigurationArrayOutput() VaultLockConfigurationArrayOutput { 196 return i.ToVaultLockConfigurationArrayOutputWithContext(context.Background()) 197 } 198 199 func (i VaultLockConfigurationArray) ToVaultLockConfigurationArrayOutputWithContext(ctx context.Context) VaultLockConfigurationArrayOutput { 200 return pulumi.ToOutputWithContext(ctx, i).(VaultLockConfigurationArrayOutput) 201 } 202 203 // VaultLockConfigurationMapInput is an input type that accepts VaultLockConfigurationMap and VaultLockConfigurationMapOutput values. 204 // You can construct a concrete instance of `VaultLockConfigurationMapInput` via: 205 // 206 // VaultLockConfigurationMap{ "key": VaultLockConfigurationArgs{...} } 207 type VaultLockConfigurationMapInput interface { 208 pulumi.Input 209 210 ToVaultLockConfigurationMapOutput() VaultLockConfigurationMapOutput 211 ToVaultLockConfigurationMapOutputWithContext(context.Context) VaultLockConfigurationMapOutput 212 } 213 214 type VaultLockConfigurationMap map[string]VaultLockConfigurationInput 215 216 func (VaultLockConfigurationMap) ElementType() reflect.Type { 217 return reflect.TypeOf((*map[string]*VaultLockConfiguration)(nil)).Elem() 218 } 219 220 func (i VaultLockConfigurationMap) ToVaultLockConfigurationMapOutput() VaultLockConfigurationMapOutput { 221 return i.ToVaultLockConfigurationMapOutputWithContext(context.Background()) 222 } 223 224 func (i VaultLockConfigurationMap) ToVaultLockConfigurationMapOutputWithContext(ctx context.Context) VaultLockConfigurationMapOutput { 225 return pulumi.ToOutputWithContext(ctx, i).(VaultLockConfigurationMapOutput) 226 } 227 228 type VaultLockConfigurationOutput struct{ *pulumi.OutputState } 229 230 func (VaultLockConfigurationOutput) ElementType() reflect.Type { 231 return reflect.TypeOf((**VaultLockConfiguration)(nil)).Elem() 232 } 233 234 func (o VaultLockConfigurationOutput) ToVaultLockConfigurationOutput() VaultLockConfigurationOutput { 235 return o 236 } 237 238 func (o VaultLockConfigurationOutput) ToVaultLockConfigurationOutputWithContext(ctx context.Context) VaultLockConfigurationOutput { 239 return o 240 } 241 242 // The ARN of the vault. 243 func (o VaultLockConfigurationOutput) BackupVaultArn() pulumi.StringOutput { 244 return o.ApplyT(func(v *VaultLockConfiguration) pulumi.StringOutput { return v.BackupVaultArn }).(pulumi.StringOutput) 245 } 246 247 // Name of the backup vault to add a lock configuration for. 248 func (o VaultLockConfigurationOutput) BackupVaultName() pulumi.StringOutput { 249 return o.ApplyT(func(v *VaultLockConfiguration) pulumi.StringOutput { return v.BackupVaultName }).(pulumi.StringOutput) 250 } 251 252 // The number of days before the lock date. If omitted creates a vault lock in `governance` mode, otherwise it will create a vault lock in `compliance` mode. 253 func (o VaultLockConfigurationOutput) ChangeableForDays() pulumi.IntPtrOutput { 254 return o.ApplyT(func(v *VaultLockConfiguration) pulumi.IntPtrOutput { return v.ChangeableForDays }).(pulumi.IntPtrOutput) 255 } 256 257 // The maximum retention period that the vault retains its recovery points. 258 func (o VaultLockConfigurationOutput) MaxRetentionDays() pulumi.IntPtrOutput { 259 return o.ApplyT(func(v *VaultLockConfiguration) pulumi.IntPtrOutput { return v.MaxRetentionDays }).(pulumi.IntPtrOutput) 260 } 261 262 // The minimum retention period that the vault retains its recovery points. 263 func (o VaultLockConfigurationOutput) MinRetentionDays() pulumi.IntPtrOutput { 264 return o.ApplyT(func(v *VaultLockConfiguration) pulumi.IntPtrOutput { return v.MinRetentionDays }).(pulumi.IntPtrOutput) 265 } 266 267 type VaultLockConfigurationArrayOutput struct{ *pulumi.OutputState } 268 269 func (VaultLockConfigurationArrayOutput) ElementType() reflect.Type { 270 return reflect.TypeOf((*[]*VaultLockConfiguration)(nil)).Elem() 271 } 272 273 func (o VaultLockConfigurationArrayOutput) ToVaultLockConfigurationArrayOutput() VaultLockConfigurationArrayOutput { 274 return o 275 } 276 277 func (o VaultLockConfigurationArrayOutput) ToVaultLockConfigurationArrayOutputWithContext(ctx context.Context) VaultLockConfigurationArrayOutput { 278 return o 279 } 280 281 func (o VaultLockConfigurationArrayOutput) Index(i pulumi.IntInput) VaultLockConfigurationOutput { 282 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VaultLockConfiguration { 283 return vs[0].([]*VaultLockConfiguration)[vs[1].(int)] 284 }).(VaultLockConfigurationOutput) 285 } 286 287 type VaultLockConfigurationMapOutput struct{ *pulumi.OutputState } 288 289 func (VaultLockConfigurationMapOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((*map[string]*VaultLockConfiguration)(nil)).Elem() 291 } 292 293 func (o VaultLockConfigurationMapOutput) ToVaultLockConfigurationMapOutput() VaultLockConfigurationMapOutput { 294 return o 295 } 296 297 func (o VaultLockConfigurationMapOutput) ToVaultLockConfigurationMapOutputWithContext(ctx context.Context) VaultLockConfigurationMapOutput { 298 return o 299 } 300 301 func (o VaultLockConfigurationMapOutput) MapIndex(k pulumi.StringInput) VaultLockConfigurationOutput { 302 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VaultLockConfiguration { 303 return vs[0].(map[string]*VaultLockConfiguration)[vs[1].(string)] 304 }).(VaultLockConfigurationOutput) 305 } 306 307 func init() { 308 pulumi.RegisterInputType(reflect.TypeOf((*VaultLockConfigurationInput)(nil)).Elem(), &VaultLockConfiguration{}) 309 pulumi.RegisterInputType(reflect.TypeOf((*VaultLockConfigurationArrayInput)(nil)).Elem(), VaultLockConfigurationArray{}) 310 pulumi.RegisterInputType(reflect.TypeOf((*VaultLockConfigurationMapInput)(nil)).Elem(), VaultLockConfigurationMap{}) 311 pulumi.RegisterOutputType(VaultLockConfigurationOutput{}) 312 pulumi.RegisterOutputType(VaultLockConfigurationArrayOutput{}) 313 pulumi.RegisterOutputType(VaultLockConfigurationMapOutput{}) 314 }