github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getVpcIpamPool.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 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // `ec2.VpcIpamPool` provides details about an IPAM pool. 15 // 16 // This resource can prove useful when an ipam pool was created in another root 17 // module and you need the pool's id as an input variable. For example, pools 18 // can be shared via RAM and used to create vpcs with CIDRs from that pool. 19 // 20 // ## Example Usage 21 // 22 // The following example shows an account that has only 1 pool, perhaps shared 23 // via RAM, and using that pool id to create a VPC with a CIDR derived from 24 // AWS IPAM. 25 // 26 // <!--Start PulumiCodeChooser --> 27 // ```go 28 // package main 29 // 30 // import ( 31 // 32 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 33 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 34 // 35 // ) 36 // 37 // func main() { 38 // pulumi.Run(func(ctx *pulumi.Context) error { 39 // test, err := ec2.LookupVpcIpamPool(ctx, &ec2.LookupVpcIpamPoolArgs{ 40 // Filters: []ec2.GetVpcIpamPoolFilter{ 41 // { 42 // Name: "description", 43 // Values: []string{ 44 // "*test*", 45 // }, 46 // }, 47 // { 48 // Name: "address-family", 49 // Values: []string{ 50 // "ipv4", 51 // }, 52 // }, 53 // }, 54 // }, nil) 55 // if err != nil { 56 // return err 57 // } 58 // _, err = ec2.NewVpc(ctx, "test", &ec2.VpcArgs{ 59 // Ipv4IpamPoolId: pulumi.String(test.Id), 60 // Ipv4NetmaskLength: pulumi.Int(28), 61 // }) 62 // if err != nil { 63 // return err 64 // } 65 // return nil 66 // }) 67 // } 68 // 69 // ``` 70 // <!--End PulumiCodeChooser --> 71 func LookupVpcIpamPool(ctx *pulumi.Context, args *LookupVpcIpamPoolArgs, opts ...pulumi.InvokeOption) (*LookupVpcIpamPoolResult, error) { 72 opts = internal.PkgInvokeDefaultOpts(opts) 73 var rv LookupVpcIpamPoolResult 74 err := ctx.Invoke("aws:ec2/getVpcIpamPool:getVpcIpamPool", args, &rv, opts...) 75 if err != nil { 76 return nil, err 77 } 78 return &rv, nil 79 } 80 81 // A collection of arguments for invoking getVpcIpamPool. 82 type LookupVpcIpamPoolArgs struct { 83 // Tags that are required to create resources in using this pool. 84 AllocationResourceTags map[string]string `pulumi:"allocationResourceTags"` 85 // Custom filter block as described below. 86 Filters []GetVpcIpamPoolFilter `pulumi:"filters"` 87 // ID of the IPAM pool. 88 Id *string `pulumi:"id"` 89 // ID of the IPAM pool you would like information on. 90 IpamPoolId *string `pulumi:"ipamPoolId"` 91 // Map of tags to assigned to the resource. 92 Tags map[string]string `pulumi:"tags"` 93 } 94 95 // A collection of values returned by getVpcIpamPool. 96 type LookupVpcIpamPoolResult struct { 97 // IP protocol assigned to this pool. 98 AddressFamily string `pulumi:"addressFamily"` 99 // A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is `10.0.0.0/8` and you enter 16 here, new allocations will default to `10.0.0.0/16`. 100 AllocationDefaultNetmaskLength int `pulumi:"allocationDefaultNetmaskLength"` 101 // The maximum netmask length that will be required for CIDR allocations in this pool. 102 AllocationMaxNetmaskLength int `pulumi:"allocationMaxNetmaskLength"` 103 // The minimum netmask length that will be required for CIDR allocations in this pool. 104 AllocationMinNetmaskLength int `pulumi:"allocationMinNetmaskLength"` 105 // Tags that are required to create resources in using this pool. 106 AllocationResourceTags map[string]string `pulumi:"allocationResourceTags"` 107 // ARN of the pool 108 Arn string `pulumi:"arn"` 109 // If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. 110 AutoImport bool `pulumi:"autoImport"` 111 // Limits which service in AWS that the pool can be used in. `ec2` for example, allows users to use space for Elastic IP addresses and VPCs. 112 AwsService string `pulumi:"awsService"` 113 // Description for the IPAM pool. 114 Description string `pulumi:"description"` 115 Filters []GetVpcIpamPoolFilter `pulumi:"filters"` 116 // ID of the IPAM pool. 117 Id *string `pulumi:"id"` 118 IpamPoolId *string `pulumi:"ipamPoolId"` 119 // ID of the scope the pool belongs to. 120 IpamScopeId string `pulumi:"ipamScopeId"` 121 IpamScopeType string `pulumi:"ipamScopeType"` 122 // Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. 123 Locale string `pulumi:"locale"` 124 PoolDepth int `pulumi:"poolDepth"` 125 // Defines whether or not IPv6 pool space is publicly advertisable over the internet. 126 PubliclyAdvertisable bool `pulumi:"publiclyAdvertisable"` 127 // ID of the source IPAM pool. 128 SourceIpamPoolId string `pulumi:"sourceIpamPoolId"` 129 State string `pulumi:"state"` 130 // Map of tags to assigned to the resource. 131 Tags map[string]string `pulumi:"tags"` 132 } 133 134 func LookupVpcIpamPoolOutput(ctx *pulumi.Context, args LookupVpcIpamPoolOutputArgs, opts ...pulumi.InvokeOption) LookupVpcIpamPoolResultOutput { 135 return pulumi.ToOutputWithContext(context.Background(), args). 136 ApplyT(func(v interface{}) (LookupVpcIpamPoolResult, error) { 137 args := v.(LookupVpcIpamPoolArgs) 138 r, err := LookupVpcIpamPool(ctx, &args, opts...) 139 var s LookupVpcIpamPoolResult 140 if r != nil { 141 s = *r 142 } 143 return s, err 144 }).(LookupVpcIpamPoolResultOutput) 145 } 146 147 // A collection of arguments for invoking getVpcIpamPool. 148 type LookupVpcIpamPoolOutputArgs struct { 149 // Tags that are required to create resources in using this pool. 150 AllocationResourceTags pulumi.StringMapInput `pulumi:"allocationResourceTags"` 151 // Custom filter block as described below. 152 Filters GetVpcIpamPoolFilterArrayInput `pulumi:"filters"` 153 // ID of the IPAM pool. 154 Id pulumi.StringPtrInput `pulumi:"id"` 155 // ID of the IPAM pool you would like information on. 156 IpamPoolId pulumi.StringPtrInput `pulumi:"ipamPoolId"` 157 // Map of tags to assigned to the resource. 158 Tags pulumi.StringMapInput `pulumi:"tags"` 159 } 160 161 func (LookupVpcIpamPoolOutputArgs) ElementType() reflect.Type { 162 return reflect.TypeOf((*LookupVpcIpamPoolArgs)(nil)).Elem() 163 } 164 165 // A collection of values returned by getVpcIpamPool. 166 type LookupVpcIpamPoolResultOutput struct{ *pulumi.OutputState } 167 168 func (LookupVpcIpamPoolResultOutput) ElementType() reflect.Type { 169 return reflect.TypeOf((*LookupVpcIpamPoolResult)(nil)).Elem() 170 } 171 172 func (o LookupVpcIpamPoolResultOutput) ToLookupVpcIpamPoolResultOutput() LookupVpcIpamPoolResultOutput { 173 return o 174 } 175 176 func (o LookupVpcIpamPoolResultOutput) ToLookupVpcIpamPoolResultOutputWithContext(ctx context.Context) LookupVpcIpamPoolResultOutput { 177 return o 178 } 179 180 // IP protocol assigned to this pool. 181 func (o LookupVpcIpamPoolResultOutput) AddressFamily() pulumi.StringOutput { 182 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.AddressFamily }).(pulumi.StringOutput) 183 } 184 185 // A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is `10.0.0.0/8` and you enter 16 here, new allocations will default to `10.0.0.0/16`. 186 func (o LookupVpcIpamPoolResultOutput) AllocationDefaultNetmaskLength() pulumi.IntOutput { 187 return o.ApplyT(func(v LookupVpcIpamPoolResult) int { return v.AllocationDefaultNetmaskLength }).(pulumi.IntOutput) 188 } 189 190 // The maximum netmask length that will be required for CIDR allocations in this pool. 191 func (o LookupVpcIpamPoolResultOutput) AllocationMaxNetmaskLength() pulumi.IntOutput { 192 return o.ApplyT(func(v LookupVpcIpamPoolResult) int { return v.AllocationMaxNetmaskLength }).(pulumi.IntOutput) 193 } 194 195 // The minimum netmask length that will be required for CIDR allocations in this pool. 196 func (o LookupVpcIpamPoolResultOutput) AllocationMinNetmaskLength() pulumi.IntOutput { 197 return o.ApplyT(func(v LookupVpcIpamPoolResult) int { return v.AllocationMinNetmaskLength }).(pulumi.IntOutput) 198 } 199 200 // Tags that are required to create resources in using this pool. 201 func (o LookupVpcIpamPoolResultOutput) AllocationResourceTags() pulumi.StringMapOutput { 202 return o.ApplyT(func(v LookupVpcIpamPoolResult) map[string]string { return v.AllocationResourceTags }).(pulumi.StringMapOutput) 203 } 204 205 // ARN of the pool 206 func (o LookupVpcIpamPoolResultOutput) Arn() pulumi.StringOutput { 207 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.Arn }).(pulumi.StringOutput) 208 } 209 210 // If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. 211 func (o LookupVpcIpamPoolResultOutput) AutoImport() pulumi.BoolOutput { 212 return o.ApplyT(func(v LookupVpcIpamPoolResult) bool { return v.AutoImport }).(pulumi.BoolOutput) 213 } 214 215 // Limits which service in AWS that the pool can be used in. `ec2` for example, allows users to use space for Elastic IP addresses and VPCs. 216 func (o LookupVpcIpamPoolResultOutput) AwsService() pulumi.StringOutput { 217 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.AwsService }).(pulumi.StringOutput) 218 } 219 220 // Description for the IPAM pool. 221 func (o LookupVpcIpamPoolResultOutput) Description() pulumi.StringOutput { 222 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.Description }).(pulumi.StringOutput) 223 } 224 225 func (o LookupVpcIpamPoolResultOutput) Filters() GetVpcIpamPoolFilterArrayOutput { 226 return o.ApplyT(func(v LookupVpcIpamPoolResult) []GetVpcIpamPoolFilter { return v.Filters }).(GetVpcIpamPoolFilterArrayOutput) 227 } 228 229 // ID of the IPAM pool. 230 func (o LookupVpcIpamPoolResultOutput) Id() pulumi.StringPtrOutput { 231 return o.ApplyT(func(v LookupVpcIpamPoolResult) *string { return v.Id }).(pulumi.StringPtrOutput) 232 } 233 234 func (o LookupVpcIpamPoolResultOutput) IpamPoolId() pulumi.StringPtrOutput { 235 return o.ApplyT(func(v LookupVpcIpamPoolResult) *string { return v.IpamPoolId }).(pulumi.StringPtrOutput) 236 } 237 238 // ID of the scope the pool belongs to. 239 func (o LookupVpcIpamPoolResultOutput) IpamScopeId() pulumi.StringOutput { 240 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.IpamScopeId }).(pulumi.StringOutput) 241 } 242 243 func (o LookupVpcIpamPoolResultOutput) IpamScopeType() pulumi.StringOutput { 244 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.IpamScopeType }).(pulumi.StringOutput) 245 } 246 247 // Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. 248 func (o LookupVpcIpamPoolResultOutput) Locale() pulumi.StringOutput { 249 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.Locale }).(pulumi.StringOutput) 250 } 251 252 func (o LookupVpcIpamPoolResultOutput) PoolDepth() pulumi.IntOutput { 253 return o.ApplyT(func(v LookupVpcIpamPoolResult) int { return v.PoolDepth }).(pulumi.IntOutput) 254 } 255 256 // Defines whether or not IPv6 pool space is publicly advertisable over the internet. 257 func (o LookupVpcIpamPoolResultOutput) PubliclyAdvertisable() pulumi.BoolOutput { 258 return o.ApplyT(func(v LookupVpcIpamPoolResult) bool { return v.PubliclyAdvertisable }).(pulumi.BoolOutput) 259 } 260 261 // ID of the source IPAM pool. 262 func (o LookupVpcIpamPoolResultOutput) SourceIpamPoolId() pulumi.StringOutput { 263 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.SourceIpamPoolId }).(pulumi.StringOutput) 264 } 265 266 func (o LookupVpcIpamPoolResultOutput) State() pulumi.StringOutput { 267 return o.ApplyT(func(v LookupVpcIpamPoolResult) string { return v.State }).(pulumi.StringOutput) 268 } 269 270 // Map of tags to assigned to the resource. 271 func (o LookupVpcIpamPoolResultOutput) Tags() pulumi.StringMapOutput { 272 return o.ApplyT(func(v LookupVpcIpamPoolResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 273 } 274 275 func init() { 276 pulumi.RegisterOutputType(LookupVpcIpamPoolResultOutput{}) 277 }