github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/vpnGatewayRoutePropagation.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 ec2 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 // Requests automatic route propagation between a VPN gateway and a route table. 16 // 17 // > **Note:** This resource should not be used with a route table that has 18 // the `propagatingVgws` argument set. If that argument is set, any route 19 // propagation not explicitly listed in its value will be removed. 20 // 21 // ## Example Usage 22 // 23 // <!--Start PulumiCodeChooser --> 24 // ```go 25 // package main 26 // 27 // import ( 28 // 29 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 30 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 31 // 32 // ) 33 // 34 // func main() { 35 // pulumi.Run(func(ctx *pulumi.Context) error { 36 // _, err := ec2.NewVpnGatewayRoutePropagation(ctx, "example", &ec2.VpnGatewayRoutePropagationArgs{ 37 // VpnGatewayId: pulumi.Any(exampleAwsVpnGateway.Id), 38 // RouteTableId: pulumi.Any(exampleAwsRouteTable.Id), 39 // }) 40 // if err != nil { 41 // return err 42 // } 43 // return nil 44 // }) 45 // } 46 // 47 // ``` 48 // <!--End PulumiCodeChooser --> 49 type VpnGatewayRoutePropagation struct { 50 pulumi.CustomResourceState 51 52 // The id of the `ec2.RouteTable` to propagate routes into. 53 RouteTableId pulumi.StringOutput `pulumi:"routeTableId"` 54 // The id of the `ec2.VpnGateway` to propagate routes from. 55 VpnGatewayId pulumi.StringOutput `pulumi:"vpnGatewayId"` 56 } 57 58 // NewVpnGatewayRoutePropagation registers a new resource with the given unique name, arguments, and options. 59 func NewVpnGatewayRoutePropagation(ctx *pulumi.Context, 60 name string, args *VpnGatewayRoutePropagationArgs, opts ...pulumi.ResourceOption) (*VpnGatewayRoutePropagation, error) { 61 if args == nil { 62 return nil, errors.New("missing one or more required arguments") 63 } 64 65 if args.RouteTableId == nil { 66 return nil, errors.New("invalid value for required argument 'RouteTableId'") 67 } 68 if args.VpnGatewayId == nil { 69 return nil, errors.New("invalid value for required argument 'VpnGatewayId'") 70 } 71 opts = internal.PkgResourceDefaultOpts(opts) 72 var resource VpnGatewayRoutePropagation 73 err := ctx.RegisterResource("aws:ec2/vpnGatewayRoutePropagation:VpnGatewayRoutePropagation", name, args, &resource, opts...) 74 if err != nil { 75 return nil, err 76 } 77 return &resource, nil 78 } 79 80 // GetVpnGatewayRoutePropagation gets an existing VpnGatewayRoutePropagation resource's state with the given name, ID, and optional 81 // state properties that are used to uniquely qualify the lookup (nil if not required). 82 func GetVpnGatewayRoutePropagation(ctx *pulumi.Context, 83 name string, id pulumi.IDInput, state *VpnGatewayRoutePropagationState, opts ...pulumi.ResourceOption) (*VpnGatewayRoutePropagation, error) { 84 var resource VpnGatewayRoutePropagation 85 err := ctx.ReadResource("aws:ec2/vpnGatewayRoutePropagation:VpnGatewayRoutePropagation", name, id, state, &resource, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return &resource, nil 90 } 91 92 // Input properties used for looking up and filtering VpnGatewayRoutePropagation resources. 93 type vpnGatewayRoutePropagationState struct { 94 // The id of the `ec2.RouteTable` to propagate routes into. 95 RouteTableId *string `pulumi:"routeTableId"` 96 // The id of the `ec2.VpnGateway` to propagate routes from. 97 VpnGatewayId *string `pulumi:"vpnGatewayId"` 98 } 99 100 type VpnGatewayRoutePropagationState struct { 101 // The id of the `ec2.RouteTable` to propagate routes into. 102 RouteTableId pulumi.StringPtrInput 103 // The id of the `ec2.VpnGateway` to propagate routes from. 104 VpnGatewayId pulumi.StringPtrInput 105 } 106 107 func (VpnGatewayRoutePropagationState) ElementType() reflect.Type { 108 return reflect.TypeOf((*vpnGatewayRoutePropagationState)(nil)).Elem() 109 } 110 111 type vpnGatewayRoutePropagationArgs struct { 112 // The id of the `ec2.RouteTable` to propagate routes into. 113 RouteTableId string `pulumi:"routeTableId"` 114 // The id of the `ec2.VpnGateway` to propagate routes from. 115 VpnGatewayId string `pulumi:"vpnGatewayId"` 116 } 117 118 // The set of arguments for constructing a VpnGatewayRoutePropagation resource. 119 type VpnGatewayRoutePropagationArgs struct { 120 // The id of the `ec2.RouteTable` to propagate routes into. 121 RouteTableId pulumi.StringInput 122 // The id of the `ec2.VpnGateway` to propagate routes from. 123 VpnGatewayId pulumi.StringInput 124 } 125 126 func (VpnGatewayRoutePropagationArgs) ElementType() reflect.Type { 127 return reflect.TypeOf((*vpnGatewayRoutePropagationArgs)(nil)).Elem() 128 } 129 130 type VpnGatewayRoutePropagationInput interface { 131 pulumi.Input 132 133 ToVpnGatewayRoutePropagationOutput() VpnGatewayRoutePropagationOutput 134 ToVpnGatewayRoutePropagationOutputWithContext(ctx context.Context) VpnGatewayRoutePropagationOutput 135 } 136 137 func (*VpnGatewayRoutePropagation) ElementType() reflect.Type { 138 return reflect.TypeOf((**VpnGatewayRoutePropagation)(nil)).Elem() 139 } 140 141 func (i *VpnGatewayRoutePropagation) ToVpnGatewayRoutePropagationOutput() VpnGatewayRoutePropagationOutput { 142 return i.ToVpnGatewayRoutePropagationOutputWithContext(context.Background()) 143 } 144 145 func (i *VpnGatewayRoutePropagation) ToVpnGatewayRoutePropagationOutputWithContext(ctx context.Context) VpnGatewayRoutePropagationOutput { 146 return pulumi.ToOutputWithContext(ctx, i).(VpnGatewayRoutePropagationOutput) 147 } 148 149 // VpnGatewayRoutePropagationArrayInput is an input type that accepts VpnGatewayRoutePropagationArray and VpnGatewayRoutePropagationArrayOutput values. 150 // You can construct a concrete instance of `VpnGatewayRoutePropagationArrayInput` via: 151 // 152 // VpnGatewayRoutePropagationArray{ VpnGatewayRoutePropagationArgs{...} } 153 type VpnGatewayRoutePropagationArrayInput interface { 154 pulumi.Input 155 156 ToVpnGatewayRoutePropagationArrayOutput() VpnGatewayRoutePropagationArrayOutput 157 ToVpnGatewayRoutePropagationArrayOutputWithContext(context.Context) VpnGatewayRoutePropagationArrayOutput 158 } 159 160 type VpnGatewayRoutePropagationArray []VpnGatewayRoutePropagationInput 161 162 func (VpnGatewayRoutePropagationArray) ElementType() reflect.Type { 163 return reflect.TypeOf((*[]*VpnGatewayRoutePropagation)(nil)).Elem() 164 } 165 166 func (i VpnGatewayRoutePropagationArray) ToVpnGatewayRoutePropagationArrayOutput() VpnGatewayRoutePropagationArrayOutput { 167 return i.ToVpnGatewayRoutePropagationArrayOutputWithContext(context.Background()) 168 } 169 170 func (i VpnGatewayRoutePropagationArray) ToVpnGatewayRoutePropagationArrayOutputWithContext(ctx context.Context) VpnGatewayRoutePropagationArrayOutput { 171 return pulumi.ToOutputWithContext(ctx, i).(VpnGatewayRoutePropagationArrayOutput) 172 } 173 174 // VpnGatewayRoutePropagationMapInput is an input type that accepts VpnGatewayRoutePropagationMap and VpnGatewayRoutePropagationMapOutput values. 175 // You can construct a concrete instance of `VpnGatewayRoutePropagationMapInput` via: 176 // 177 // VpnGatewayRoutePropagationMap{ "key": VpnGatewayRoutePropagationArgs{...} } 178 type VpnGatewayRoutePropagationMapInput interface { 179 pulumi.Input 180 181 ToVpnGatewayRoutePropagationMapOutput() VpnGatewayRoutePropagationMapOutput 182 ToVpnGatewayRoutePropagationMapOutputWithContext(context.Context) VpnGatewayRoutePropagationMapOutput 183 } 184 185 type VpnGatewayRoutePropagationMap map[string]VpnGatewayRoutePropagationInput 186 187 func (VpnGatewayRoutePropagationMap) ElementType() reflect.Type { 188 return reflect.TypeOf((*map[string]*VpnGatewayRoutePropagation)(nil)).Elem() 189 } 190 191 func (i VpnGatewayRoutePropagationMap) ToVpnGatewayRoutePropagationMapOutput() VpnGatewayRoutePropagationMapOutput { 192 return i.ToVpnGatewayRoutePropagationMapOutputWithContext(context.Background()) 193 } 194 195 func (i VpnGatewayRoutePropagationMap) ToVpnGatewayRoutePropagationMapOutputWithContext(ctx context.Context) VpnGatewayRoutePropagationMapOutput { 196 return pulumi.ToOutputWithContext(ctx, i).(VpnGatewayRoutePropagationMapOutput) 197 } 198 199 type VpnGatewayRoutePropagationOutput struct{ *pulumi.OutputState } 200 201 func (VpnGatewayRoutePropagationOutput) ElementType() reflect.Type { 202 return reflect.TypeOf((**VpnGatewayRoutePropagation)(nil)).Elem() 203 } 204 205 func (o VpnGatewayRoutePropagationOutput) ToVpnGatewayRoutePropagationOutput() VpnGatewayRoutePropagationOutput { 206 return o 207 } 208 209 func (o VpnGatewayRoutePropagationOutput) ToVpnGatewayRoutePropagationOutputWithContext(ctx context.Context) VpnGatewayRoutePropagationOutput { 210 return o 211 } 212 213 // The id of the `ec2.RouteTable` to propagate routes into. 214 func (o VpnGatewayRoutePropagationOutput) RouteTableId() pulumi.StringOutput { 215 return o.ApplyT(func(v *VpnGatewayRoutePropagation) pulumi.StringOutput { return v.RouteTableId }).(pulumi.StringOutput) 216 } 217 218 // The id of the `ec2.VpnGateway` to propagate routes from. 219 func (o VpnGatewayRoutePropagationOutput) VpnGatewayId() pulumi.StringOutput { 220 return o.ApplyT(func(v *VpnGatewayRoutePropagation) pulumi.StringOutput { return v.VpnGatewayId }).(pulumi.StringOutput) 221 } 222 223 type VpnGatewayRoutePropagationArrayOutput struct{ *pulumi.OutputState } 224 225 func (VpnGatewayRoutePropagationArrayOutput) ElementType() reflect.Type { 226 return reflect.TypeOf((*[]*VpnGatewayRoutePropagation)(nil)).Elem() 227 } 228 229 func (o VpnGatewayRoutePropagationArrayOutput) ToVpnGatewayRoutePropagationArrayOutput() VpnGatewayRoutePropagationArrayOutput { 230 return o 231 } 232 233 func (o VpnGatewayRoutePropagationArrayOutput) ToVpnGatewayRoutePropagationArrayOutputWithContext(ctx context.Context) VpnGatewayRoutePropagationArrayOutput { 234 return o 235 } 236 237 func (o VpnGatewayRoutePropagationArrayOutput) Index(i pulumi.IntInput) VpnGatewayRoutePropagationOutput { 238 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VpnGatewayRoutePropagation { 239 return vs[0].([]*VpnGatewayRoutePropagation)[vs[1].(int)] 240 }).(VpnGatewayRoutePropagationOutput) 241 } 242 243 type VpnGatewayRoutePropagationMapOutput struct{ *pulumi.OutputState } 244 245 func (VpnGatewayRoutePropagationMapOutput) ElementType() reflect.Type { 246 return reflect.TypeOf((*map[string]*VpnGatewayRoutePropagation)(nil)).Elem() 247 } 248 249 func (o VpnGatewayRoutePropagationMapOutput) ToVpnGatewayRoutePropagationMapOutput() VpnGatewayRoutePropagationMapOutput { 250 return o 251 } 252 253 func (o VpnGatewayRoutePropagationMapOutput) ToVpnGatewayRoutePropagationMapOutputWithContext(ctx context.Context) VpnGatewayRoutePropagationMapOutput { 254 return o 255 } 256 257 func (o VpnGatewayRoutePropagationMapOutput) MapIndex(k pulumi.StringInput) VpnGatewayRoutePropagationOutput { 258 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VpnGatewayRoutePropagation { 259 return vs[0].(map[string]*VpnGatewayRoutePropagation)[vs[1].(string)] 260 }).(VpnGatewayRoutePropagationOutput) 261 } 262 263 func init() { 264 pulumi.RegisterInputType(reflect.TypeOf((*VpnGatewayRoutePropagationInput)(nil)).Elem(), &VpnGatewayRoutePropagation{}) 265 pulumi.RegisterInputType(reflect.TypeOf((*VpnGatewayRoutePropagationArrayInput)(nil)).Elem(), VpnGatewayRoutePropagationArray{}) 266 pulumi.RegisterInputType(reflect.TypeOf((*VpnGatewayRoutePropagationMapInput)(nil)).Elem(), VpnGatewayRoutePropagationMap{}) 267 pulumi.RegisterOutputType(VpnGatewayRoutePropagationOutput{}) 268 pulumi.RegisterOutputType(VpnGatewayRoutePropagationArrayOutput{}) 269 pulumi.RegisterOutputType(VpnGatewayRoutePropagationMapOutput{}) 270 }