github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/policyTable.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 ec2transitgateway 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 an EC2 Transit Gateway Policy Table. 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/ec2transitgateway" 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 := ec2transitgateway.NewPolicyTable(ctx, "example", &ec2transitgateway.PolicyTableArgs{ 33 // TransitGatewayId: pulumi.Any(exampleAwsEc2TransitGateway.Id), 34 // Tags: pulumi.StringMap{ 35 // "Name": pulumi.String("Example Policy Table"), 36 // }, 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 `aws_ec2_transit_gateway_policy_table` using the EC2 Transit Gateway Policy Table identifier. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:ec2transitgateway/policyTable:PolicyTable example tgw-rtb-12345678 54 // ``` 55 type PolicyTable struct { 56 pulumi.CustomResourceState 57 58 // EC2 Transit Gateway Policy Table Amazon Resource Name (ARN). 59 Arn pulumi.StringOutput `pulumi:"arn"` 60 // The state of the EC2 Transit Gateway Policy Table. 61 State pulumi.StringOutput `pulumi:"state"` 62 // Key-value tags for the EC2 Transit Gateway Policy Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 63 Tags pulumi.StringMapOutput `pulumi:"tags"` 64 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 65 // 66 // Deprecated: Please use `tags` instead. 67 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 68 // EC2 Transit Gateway identifier. 69 TransitGatewayId pulumi.StringOutput `pulumi:"transitGatewayId"` 70 } 71 72 // NewPolicyTable registers a new resource with the given unique name, arguments, and options. 73 func NewPolicyTable(ctx *pulumi.Context, 74 name string, args *PolicyTableArgs, opts ...pulumi.ResourceOption) (*PolicyTable, error) { 75 if args == nil { 76 return nil, errors.New("missing one or more required arguments") 77 } 78 79 if args.TransitGatewayId == nil { 80 return nil, errors.New("invalid value for required argument 'TransitGatewayId'") 81 } 82 opts = internal.PkgResourceDefaultOpts(opts) 83 var resource PolicyTable 84 err := ctx.RegisterResource("aws:ec2transitgateway/policyTable:PolicyTable", name, args, &resource, opts...) 85 if err != nil { 86 return nil, err 87 } 88 return &resource, nil 89 } 90 91 // GetPolicyTable gets an existing PolicyTable resource's state with the given name, ID, and optional 92 // state properties that are used to uniquely qualify the lookup (nil if not required). 93 func GetPolicyTable(ctx *pulumi.Context, 94 name string, id pulumi.IDInput, state *PolicyTableState, opts ...pulumi.ResourceOption) (*PolicyTable, error) { 95 var resource PolicyTable 96 err := ctx.ReadResource("aws:ec2transitgateway/policyTable:PolicyTable", name, id, state, &resource, opts...) 97 if err != nil { 98 return nil, err 99 } 100 return &resource, nil 101 } 102 103 // Input properties used for looking up and filtering PolicyTable resources. 104 type policyTableState struct { 105 // EC2 Transit Gateway Policy Table Amazon Resource Name (ARN). 106 Arn *string `pulumi:"arn"` 107 // The state of the EC2 Transit Gateway Policy Table. 108 State *string `pulumi:"state"` 109 // Key-value tags for the EC2 Transit Gateway Policy Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 110 Tags map[string]string `pulumi:"tags"` 111 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 112 // 113 // Deprecated: Please use `tags` instead. 114 TagsAll map[string]string `pulumi:"tagsAll"` 115 // EC2 Transit Gateway identifier. 116 TransitGatewayId *string `pulumi:"transitGatewayId"` 117 } 118 119 type PolicyTableState struct { 120 // EC2 Transit Gateway Policy Table Amazon Resource Name (ARN). 121 Arn pulumi.StringPtrInput 122 // The state of the EC2 Transit Gateway Policy Table. 123 State pulumi.StringPtrInput 124 // Key-value tags for the EC2 Transit Gateway Policy Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 125 Tags pulumi.StringMapInput 126 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 127 // 128 // Deprecated: Please use `tags` instead. 129 TagsAll pulumi.StringMapInput 130 // EC2 Transit Gateway identifier. 131 TransitGatewayId pulumi.StringPtrInput 132 } 133 134 func (PolicyTableState) ElementType() reflect.Type { 135 return reflect.TypeOf((*policyTableState)(nil)).Elem() 136 } 137 138 type policyTableArgs struct { 139 // Key-value tags for the EC2 Transit Gateway Policy Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 140 Tags map[string]string `pulumi:"tags"` 141 // EC2 Transit Gateway identifier. 142 TransitGatewayId string `pulumi:"transitGatewayId"` 143 } 144 145 // The set of arguments for constructing a PolicyTable resource. 146 type PolicyTableArgs struct { 147 // Key-value tags for the EC2 Transit Gateway Policy Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 148 Tags pulumi.StringMapInput 149 // EC2 Transit Gateway identifier. 150 TransitGatewayId pulumi.StringInput 151 } 152 153 func (PolicyTableArgs) ElementType() reflect.Type { 154 return reflect.TypeOf((*policyTableArgs)(nil)).Elem() 155 } 156 157 type PolicyTableInput interface { 158 pulumi.Input 159 160 ToPolicyTableOutput() PolicyTableOutput 161 ToPolicyTableOutputWithContext(ctx context.Context) PolicyTableOutput 162 } 163 164 func (*PolicyTable) ElementType() reflect.Type { 165 return reflect.TypeOf((**PolicyTable)(nil)).Elem() 166 } 167 168 func (i *PolicyTable) ToPolicyTableOutput() PolicyTableOutput { 169 return i.ToPolicyTableOutputWithContext(context.Background()) 170 } 171 172 func (i *PolicyTable) ToPolicyTableOutputWithContext(ctx context.Context) PolicyTableOutput { 173 return pulumi.ToOutputWithContext(ctx, i).(PolicyTableOutput) 174 } 175 176 // PolicyTableArrayInput is an input type that accepts PolicyTableArray and PolicyTableArrayOutput values. 177 // You can construct a concrete instance of `PolicyTableArrayInput` via: 178 // 179 // PolicyTableArray{ PolicyTableArgs{...} } 180 type PolicyTableArrayInput interface { 181 pulumi.Input 182 183 ToPolicyTableArrayOutput() PolicyTableArrayOutput 184 ToPolicyTableArrayOutputWithContext(context.Context) PolicyTableArrayOutput 185 } 186 187 type PolicyTableArray []PolicyTableInput 188 189 func (PolicyTableArray) ElementType() reflect.Type { 190 return reflect.TypeOf((*[]*PolicyTable)(nil)).Elem() 191 } 192 193 func (i PolicyTableArray) ToPolicyTableArrayOutput() PolicyTableArrayOutput { 194 return i.ToPolicyTableArrayOutputWithContext(context.Background()) 195 } 196 197 func (i PolicyTableArray) ToPolicyTableArrayOutputWithContext(ctx context.Context) PolicyTableArrayOutput { 198 return pulumi.ToOutputWithContext(ctx, i).(PolicyTableArrayOutput) 199 } 200 201 // PolicyTableMapInput is an input type that accepts PolicyTableMap and PolicyTableMapOutput values. 202 // You can construct a concrete instance of `PolicyTableMapInput` via: 203 // 204 // PolicyTableMap{ "key": PolicyTableArgs{...} } 205 type PolicyTableMapInput interface { 206 pulumi.Input 207 208 ToPolicyTableMapOutput() PolicyTableMapOutput 209 ToPolicyTableMapOutputWithContext(context.Context) PolicyTableMapOutput 210 } 211 212 type PolicyTableMap map[string]PolicyTableInput 213 214 func (PolicyTableMap) ElementType() reflect.Type { 215 return reflect.TypeOf((*map[string]*PolicyTable)(nil)).Elem() 216 } 217 218 func (i PolicyTableMap) ToPolicyTableMapOutput() PolicyTableMapOutput { 219 return i.ToPolicyTableMapOutputWithContext(context.Background()) 220 } 221 222 func (i PolicyTableMap) ToPolicyTableMapOutputWithContext(ctx context.Context) PolicyTableMapOutput { 223 return pulumi.ToOutputWithContext(ctx, i).(PolicyTableMapOutput) 224 } 225 226 type PolicyTableOutput struct{ *pulumi.OutputState } 227 228 func (PolicyTableOutput) ElementType() reflect.Type { 229 return reflect.TypeOf((**PolicyTable)(nil)).Elem() 230 } 231 232 func (o PolicyTableOutput) ToPolicyTableOutput() PolicyTableOutput { 233 return o 234 } 235 236 func (o PolicyTableOutput) ToPolicyTableOutputWithContext(ctx context.Context) PolicyTableOutput { 237 return o 238 } 239 240 // EC2 Transit Gateway Policy Table Amazon Resource Name (ARN). 241 func (o PolicyTableOutput) Arn() pulumi.StringOutput { 242 return o.ApplyT(func(v *PolicyTable) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 243 } 244 245 // The state of the EC2 Transit Gateway Policy Table. 246 func (o PolicyTableOutput) State() pulumi.StringOutput { 247 return o.ApplyT(func(v *PolicyTable) pulumi.StringOutput { return v.State }).(pulumi.StringOutput) 248 } 249 250 // Key-value tags for the EC2 Transit Gateway Policy Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 251 func (o PolicyTableOutput) Tags() pulumi.StringMapOutput { 252 return o.ApplyT(func(v *PolicyTable) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 253 } 254 255 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 256 // 257 // Deprecated: Please use `tags` instead. 258 func (o PolicyTableOutput) TagsAll() pulumi.StringMapOutput { 259 return o.ApplyT(func(v *PolicyTable) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 260 } 261 262 // EC2 Transit Gateway identifier. 263 func (o PolicyTableOutput) TransitGatewayId() pulumi.StringOutput { 264 return o.ApplyT(func(v *PolicyTable) pulumi.StringOutput { return v.TransitGatewayId }).(pulumi.StringOutput) 265 } 266 267 type PolicyTableArrayOutput struct{ *pulumi.OutputState } 268 269 func (PolicyTableArrayOutput) ElementType() reflect.Type { 270 return reflect.TypeOf((*[]*PolicyTable)(nil)).Elem() 271 } 272 273 func (o PolicyTableArrayOutput) ToPolicyTableArrayOutput() PolicyTableArrayOutput { 274 return o 275 } 276 277 func (o PolicyTableArrayOutput) ToPolicyTableArrayOutputWithContext(ctx context.Context) PolicyTableArrayOutput { 278 return o 279 } 280 281 func (o PolicyTableArrayOutput) Index(i pulumi.IntInput) PolicyTableOutput { 282 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PolicyTable { 283 return vs[0].([]*PolicyTable)[vs[1].(int)] 284 }).(PolicyTableOutput) 285 } 286 287 type PolicyTableMapOutput struct{ *pulumi.OutputState } 288 289 func (PolicyTableMapOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((*map[string]*PolicyTable)(nil)).Elem() 291 } 292 293 func (o PolicyTableMapOutput) ToPolicyTableMapOutput() PolicyTableMapOutput { 294 return o 295 } 296 297 func (o PolicyTableMapOutput) ToPolicyTableMapOutputWithContext(ctx context.Context) PolicyTableMapOutput { 298 return o 299 } 300 301 func (o PolicyTableMapOutput) MapIndex(k pulumi.StringInput) PolicyTableOutput { 302 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PolicyTable { 303 return vs[0].(map[string]*PolicyTable)[vs[1].(string)] 304 }).(PolicyTableOutput) 305 } 306 307 func init() { 308 pulumi.RegisterInputType(reflect.TypeOf((*PolicyTableInput)(nil)).Elem(), &PolicyTable{}) 309 pulumi.RegisterInputType(reflect.TypeOf((*PolicyTableArrayInput)(nil)).Elem(), PolicyTableArray{}) 310 pulumi.RegisterInputType(reflect.TypeOf((*PolicyTableMapInput)(nil)).Elem(), PolicyTableMap{}) 311 pulumi.RegisterOutputType(PolicyTableOutput{}) 312 pulumi.RegisterOutputType(PolicyTableArrayOutput{}) 313 pulumi.RegisterOutputType(PolicyTableMapOutput{}) 314 }