github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/verifiedpermissions/policyStore.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 verifiedpermissions 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 // ## Example Usage 15 // 16 // ### Basic Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/verifiedpermissions" 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 := verifiedpermissions.NewPolicyStore(ctx, "example", &verifiedpermissions.PolicyStoreArgs{ 32 // ValidationSettings: &verifiedpermissions.PolicyStoreValidationSettingsArgs{ 33 // Mode: pulumi.String("STRICT"), 34 // }, 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 Verified Permissions Policy Store using the `policy_store_id`. For example: 49 // 50 // console 51 // 52 // % pulumi import aws_verifiedpermissions_policy_store.example DxQg2j8xvXJQ1tQCYNWj9T 53 type PolicyStore struct { 54 pulumi.CustomResourceState 55 56 // The ARN of the Policy Store. 57 Arn pulumi.StringOutput `pulumi:"arn"` 58 // A description of the Policy Store. 59 Description pulumi.StringPtrOutput `pulumi:"description"` 60 // The ID of the Policy Store. 61 PolicyStoreId pulumi.StringOutput `pulumi:"policyStoreId"` 62 // Validation settings for the policy store. 63 ValidationSettings PolicyStoreValidationSettingsPtrOutput `pulumi:"validationSettings"` 64 } 65 66 // NewPolicyStore registers a new resource with the given unique name, arguments, and options. 67 func NewPolicyStore(ctx *pulumi.Context, 68 name string, args *PolicyStoreArgs, opts ...pulumi.ResourceOption) (*PolicyStore, error) { 69 if args == nil { 70 args = &PolicyStoreArgs{} 71 } 72 73 opts = internal.PkgResourceDefaultOpts(opts) 74 var resource PolicyStore 75 err := ctx.RegisterResource("aws:verifiedpermissions/policyStore:PolicyStore", name, args, &resource, opts...) 76 if err != nil { 77 return nil, err 78 } 79 return &resource, nil 80 } 81 82 // GetPolicyStore gets an existing PolicyStore 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 GetPolicyStore(ctx *pulumi.Context, 85 name string, id pulumi.IDInput, state *PolicyStoreState, opts ...pulumi.ResourceOption) (*PolicyStore, error) { 86 var resource PolicyStore 87 err := ctx.ReadResource("aws:verifiedpermissions/policyStore:PolicyStore", 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 PolicyStore resources. 95 type policyStoreState struct { 96 // The ARN of the Policy Store. 97 Arn *string `pulumi:"arn"` 98 // A description of the Policy Store. 99 Description *string `pulumi:"description"` 100 // The ID of the Policy Store. 101 PolicyStoreId *string `pulumi:"policyStoreId"` 102 // Validation settings for the policy store. 103 ValidationSettings *PolicyStoreValidationSettings `pulumi:"validationSettings"` 104 } 105 106 type PolicyStoreState struct { 107 // The ARN of the Policy Store. 108 Arn pulumi.StringPtrInput 109 // A description of the Policy Store. 110 Description pulumi.StringPtrInput 111 // The ID of the Policy Store. 112 PolicyStoreId pulumi.StringPtrInput 113 // Validation settings for the policy store. 114 ValidationSettings PolicyStoreValidationSettingsPtrInput 115 } 116 117 func (PolicyStoreState) ElementType() reflect.Type { 118 return reflect.TypeOf((*policyStoreState)(nil)).Elem() 119 } 120 121 type policyStoreArgs struct { 122 // A description of the Policy Store. 123 Description *string `pulumi:"description"` 124 // Validation settings for the policy store. 125 ValidationSettings *PolicyStoreValidationSettings `pulumi:"validationSettings"` 126 } 127 128 // The set of arguments for constructing a PolicyStore resource. 129 type PolicyStoreArgs struct { 130 // A description of the Policy Store. 131 Description pulumi.StringPtrInput 132 // Validation settings for the policy store. 133 ValidationSettings PolicyStoreValidationSettingsPtrInput 134 } 135 136 func (PolicyStoreArgs) ElementType() reflect.Type { 137 return reflect.TypeOf((*policyStoreArgs)(nil)).Elem() 138 } 139 140 type PolicyStoreInput interface { 141 pulumi.Input 142 143 ToPolicyStoreOutput() PolicyStoreOutput 144 ToPolicyStoreOutputWithContext(ctx context.Context) PolicyStoreOutput 145 } 146 147 func (*PolicyStore) ElementType() reflect.Type { 148 return reflect.TypeOf((**PolicyStore)(nil)).Elem() 149 } 150 151 func (i *PolicyStore) ToPolicyStoreOutput() PolicyStoreOutput { 152 return i.ToPolicyStoreOutputWithContext(context.Background()) 153 } 154 155 func (i *PolicyStore) ToPolicyStoreOutputWithContext(ctx context.Context) PolicyStoreOutput { 156 return pulumi.ToOutputWithContext(ctx, i).(PolicyStoreOutput) 157 } 158 159 // PolicyStoreArrayInput is an input type that accepts PolicyStoreArray and PolicyStoreArrayOutput values. 160 // You can construct a concrete instance of `PolicyStoreArrayInput` via: 161 // 162 // PolicyStoreArray{ PolicyStoreArgs{...} } 163 type PolicyStoreArrayInput interface { 164 pulumi.Input 165 166 ToPolicyStoreArrayOutput() PolicyStoreArrayOutput 167 ToPolicyStoreArrayOutputWithContext(context.Context) PolicyStoreArrayOutput 168 } 169 170 type PolicyStoreArray []PolicyStoreInput 171 172 func (PolicyStoreArray) ElementType() reflect.Type { 173 return reflect.TypeOf((*[]*PolicyStore)(nil)).Elem() 174 } 175 176 func (i PolicyStoreArray) ToPolicyStoreArrayOutput() PolicyStoreArrayOutput { 177 return i.ToPolicyStoreArrayOutputWithContext(context.Background()) 178 } 179 180 func (i PolicyStoreArray) ToPolicyStoreArrayOutputWithContext(ctx context.Context) PolicyStoreArrayOutput { 181 return pulumi.ToOutputWithContext(ctx, i).(PolicyStoreArrayOutput) 182 } 183 184 // PolicyStoreMapInput is an input type that accepts PolicyStoreMap and PolicyStoreMapOutput values. 185 // You can construct a concrete instance of `PolicyStoreMapInput` via: 186 // 187 // PolicyStoreMap{ "key": PolicyStoreArgs{...} } 188 type PolicyStoreMapInput interface { 189 pulumi.Input 190 191 ToPolicyStoreMapOutput() PolicyStoreMapOutput 192 ToPolicyStoreMapOutputWithContext(context.Context) PolicyStoreMapOutput 193 } 194 195 type PolicyStoreMap map[string]PolicyStoreInput 196 197 func (PolicyStoreMap) ElementType() reflect.Type { 198 return reflect.TypeOf((*map[string]*PolicyStore)(nil)).Elem() 199 } 200 201 func (i PolicyStoreMap) ToPolicyStoreMapOutput() PolicyStoreMapOutput { 202 return i.ToPolicyStoreMapOutputWithContext(context.Background()) 203 } 204 205 func (i PolicyStoreMap) ToPolicyStoreMapOutputWithContext(ctx context.Context) PolicyStoreMapOutput { 206 return pulumi.ToOutputWithContext(ctx, i).(PolicyStoreMapOutput) 207 } 208 209 type PolicyStoreOutput struct{ *pulumi.OutputState } 210 211 func (PolicyStoreOutput) ElementType() reflect.Type { 212 return reflect.TypeOf((**PolicyStore)(nil)).Elem() 213 } 214 215 func (o PolicyStoreOutput) ToPolicyStoreOutput() PolicyStoreOutput { 216 return o 217 } 218 219 func (o PolicyStoreOutput) ToPolicyStoreOutputWithContext(ctx context.Context) PolicyStoreOutput { 220 return o 221 } 222 223 // The ARN of the Policy Store. 224 func (o PolicyStoreOutput) Arn() pulumi.StringOutput { 225 return o.ApplyT(func(v *PolicyStore) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 226 } 227 228 // A description of the Policy Store. 229 func (o PolicyStoreOutput) Description() pulumi.StringPtrOutput { 230 return o.ApplyT(func(v *PolicyStore) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 231 } 232 233 // The ID of the Policy Store. 234 func (o PolicyStoreOutput) PolicyStoreId() pulumi.StringOutput { 235 return o.ApplyT(func(v *PolicyStore) pulumi.StringOutput { return v.PolicyStoreId }).(pulumi.StringOutput) 236 } 237 238 // Validation settings for the policy store. 239 func (o PolicyStoreOutput) ValidationSettings() PolicyStoreValidationSettingsPtrOutput { 240 return o.ApplyT(func(v *PolicyStore) PolicyStoreValidationSettingsPtrOutput { return v.ValidationSettings }).(PolicyStoreValidationSettingsPtrOutput) 241 } 242 243 type PolicyStoreArrayOutput struct{ *pulumi.OutputState } 244 245 func (PolicyStoreArrayOutput) ElementType() reflect.Type { 246 return reflect.TypeOf((*[]*PolicyStore)(nil)).Elem() 247 } 248 249 func (o PolicyStoreArrayOutput) ToPolicyStoreArrayOutput() PolicyStoreArrayOutput { 250 return o 251 } 252 253 func (o PolicyStoreArrayOutput) ToPolicyStoreArrayOutputWithContext(ctx context.Context) PolicyStoreArrayOutput { 254 return o 255 } 256 257 func (o PolicyStoreArrayOutput) Index(i pulumi.IntInput) PolicyStoreOutput { 258 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PolicyStore { 259 return vs[0].([]*PolicyStore)[vs[1].(int)] 260 }).(PolicyStoreOutput) 261 } 262 263 type PolicyStoreMapOutput struct{ *pulumi.OutputState } 264 265 func (PolicyStoreMapOutput) ElementType() reflect.Type { 266 return reflect.TypeOf((*map[string]*PolicyStore)(nil)).Elem() 267 } 268 269 func (o PolicyStoreMapOutput) ToPolicyStoreMapOutput() PolicyStoreMapOutput { 270 return o 271 } 272 273 func (o PolicyStoreMapOutput) ToPolicyStoreMapOutputWithContext(ctx context.Context) PolicyStoreMapOutput { 274 return o 275 } 276 277 func (o PolicyStoreMapOutput) MapIndex(k pulumi.StringInput) PolicyStoreOutput { 278 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PolicyStore { 279 return vs[0].(map[string]*PolicyStore)[vs[1].(string)] 280 }).(PolicyStoreOutput) 281 } 282 283 func init() { 284 pulumi.RegisterInputType(reflect.TypeOf((*PolicyStoreInput)(nil)).Elem(), &PolicyStore{}) 285 pulumi.RegisterInputType(reflect.TypeOf((*PolicyStoreArrayInput)(nil)).Elem(), PolicyStoreArray{}) 286 pulumi.RegisterInputType(reflect.TypeOf((*PolicyStoreMapInput)(nil)).Elem(), PolicyStoreMap{}) 287 pulumi.RegisterOutputType(PolicyStoreOutput{}) 288 pulumi.RegisterOutputType(PolicyStoreArrayOutput{}) 289 pulumi.RegisterOutputType(PolicyStoreMapOutput{}) 290 }