github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getVpcIamPool.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 // 72 // Deprecated: aws.ec2/getvpciampool.getVpcIamPool has been deprecated in favor of aws.ec2/getvpcipampool.getVpcIpamPool 73 func GetVpcIamPool(ctx *pulumi.Context, args *GetVpcIamPoolArgs, opts ...pulumi.InvokeOption) (*GetVpcIamPoolResult, error) { 74 opts = internal.PkgInvokeDefaultOpts(opts) 75 var rv GetVpcIamPoolResult 76 err := ctx.Invoke("aws:ec2/getVpcIamPool:getVpcIamPool", args, &rv, opts...) 77 if err != nil { 78 return nil, err 79 } 80 return &rv, nil 81 } 82 83 // A collection of arguments for invoking getVpcIamPool. 84 type GetVpcIamPoolArgs struct { 85 // Tags that are required to create resources in using this pool. 86 AllocationResourceTags map[string]string `pulumi:"allocationResourceTags"` 87 // Custom filter block as described below. 88 Filters []GetVpcIamPoolFilter `pulumi:"filters"` 89 // ID of the IPAM pool. 90 Id *string `pulumi:"id"` 91 // ID of the IPAM pool you would like information on. 92 IpamPoolId *string `pulumi:"ipamPoolId"` 93 // Map of tags to assigned to the resource. 94 Tags map[string]string `pulumi:"tags"` 95 } 96 97 // A collection of values returned by getVpcIamPool. 98 type GetVpcIamPoolResult struct { 99 // IP protocol assigned to this pool. 100 AddressFamily string `pulumi:"addressFamily"` 101 // 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`. 102 AllocationDefaultNetmaskLength int `pulumi:"allocationDefaultNetmaskLength"` 103 // The maximum netmask length that will be required for CIDR allocations in this pool. 104 AllocationMaxNetmaskLength int `pulumi:"allocationMaxNetmaskLength"` 105 // The minimum netmask length that will be required for CIDR allocations in this pool. 106 AllocationMinNetmaskLength int `pulumi:"allocationMinNetmaskLength"` 107 // Tags that are required to create resources in using this pool. 108 AllocationResourceTags map[string]string `pulumi:"allocationResourceTags"` 109 // ARN of the pool 110 Arn string `pulumi:"arn"` 111 // If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. 112 AutoImport bool `pulumi:"autoImport"` 113 // 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. 114 AwsService string `pulumi:"awsService"` 115 // Description for the IPAM pool. 116 Description string `pulumi:"description"` 117 Filters []GetVpcIamPoolFilter `pulumi:"filters"` 118 // ID of the IPAM pool. 119 Id *string `pulumi:"id"` 120 IpamPoolId *string `pulumi:"ipamPoolId"` 121 // ID of the scope the pool belongs to. 122 IpamScopeId string `pulumi:"ipamScopeId"` 123 IpamScopeType string `pulumi:"ipamScopeType"` 124 // 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. 125 Locale string `pulumi:"locale"` 126 PoolDepth int `pulumi:"poolDepth"` 127 // Defines whether or not IPv6 pool space is publicly advertisable over the internet. 128 PubliclyAdvertisable bool `pulumi:"publiclyAdvertisable"` 129 // ID of the source IPAM pool. 130 SourceIpamPoolId string `pulumi:"sourceIpamPoolId"` 131 State string `pulumi:"state"` 132 // Map of tags to assigned to the resource. 133 Tags map[string]string `pulumi:"tags"` 134 } 135 136 func GetVpcIamPoolOutput(ctx *pulumi.Context, args GetVpcIamPoolOutputArgs, opts ...pulumi.InvokeOption) GetVpcIamPoolResultOutput { 137 return pulumi.ToOutputWithContext(context.Background(), args). 138 ApplyT(func(v interface{}) (GetVpcIamPoolResult, error) { 139 args := v.(GetVpcIamPoolArgs) 140 r, err := GetVpcIamPool(ctx, &args, opts...) 141 var s GetVpcIamPoolResult 142 if r != nil { 143 s = *r 144 } 145 return s, err 146 }).(GetVpcIamPoolResultOutput) 147 } 148 149 // A collection of arguments for invoking getVpcIamPool. 150 type GetVpcIamPoolOutputArgs struct { 151 // Tags that are required to create resources in using this pool. 152 AllocationResourceTags pulumi.StringMapInput `pulumi:"allocationResourceTags"` 153 // Custom filter block as described below. 154 Filters GetVpcIamPoolFilterArrayInput `pulumi:"filters"` 155 // ID of the IPAM pool. 156 Id pulumi.StringPtrInput `pulumi:"id"` 157 // ID of the IPAM pool you would like information on. 158 IpamPoolId pulumi.StringPtrInput `pulumi:"ipamPoolId"` 159 // Map of tags to assigned to the resource. 160 Tags pulumi.StringMapInput `pulumi:"tags"` 161 } 162 163 func (GetVpcIamPoolOutputArgs) ElementType() reflect.Type { 164 return reflect.TypeOf((*GetVpcIamPoolArgs)(nil)).Elem() 165 } 166 167 // A collection of values returned by getVpcIamPool. 168 type GetVpcIamPoolResultOutput struct{ *pulumi.OutputState } 169 170 func (GetVpcIamPoolResultOutput) ElementType() reflect.Type { 171 return reflect.TypeOf((*GetVpcIamPoolResult)(nil)).Elem() 172 } 173 174 func (o GetVpcIamPoolResultOutput) ToGetVpcIamPoolResultOutput() GetVpcIamPoolResultOutput { 175 return o 176 } 177 178 func (o GetVpcIamPoolResultOutput) ToGetVpcIamPoolResultOutputWithContext(ctx context.Context) GetVpcIamPoolResultOutput { 179 return o 180 } 181 182 // IP protocol assigned to this pool. 183 func (o GetVpcIamPoolResultOutput) AddressFamily() pulumi.StringOutput { 184 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.AddressFamily }).(pulumi.StringOutput) 185 } 186 187 // 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`. 188 func (o GetVpcIamPoolResultOutput) AllocationDefaultNetmaskLength() pulumi.IntOutput { 189 return o.ApplyT(func(v GetVpcIamPoolResult) int { return v.AllocationDefaultNetmaskLength }).(pulumi.IntOutput) 190 } 191 192 // The maximum netmask length that will be required for CIDR allocations in this pool. 193 func (o GetVpcIamPoolResultOutput) AllocationMaxNetmaskLength() pulumi.IntOutput { 194 return o.ApplyT(func(v GetVpcIamPoolResult) int { return v.AllocationMaxNetmaskLength }).(pulumi.IntOutput) 195 } 196 197 // The minimum netmask length that will be required for CIDR allocations in this pool. 198 func (o GetVpcIamPoolResultOutput) AllocationMinNetmaskLength() pulumi.IntOutput { 199 return o.ApplyT(func(v GetVpcIamPoolResult) int { return v.AllocationMinNetmaskLength }).(pulumi.IntOutput) 200 } 201 202 // Tags that are required to create resources in using this pool. 203 func (o GetVpcIamPoolResultOutput) AllocationResourceTags() pulumi.StringMapOutput { 204 return o.ApplyT(func(v GetVpcIamPoolResult) map[string]string { return v.AllocationResourceTags }).(pulumi.StringMapOutput) 205 } 206 207 // ARN of the pool 208 func (o GetVpcIamPoolResultOutput) Arn() pulumi.StringOutput { 209 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.Arn }).(pulumi.StringOutput) 210 } 211 212 // If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. 213 func (o GetVpcIamPoolResultOutput) AutoImport() pulumi.BoolOutput { 214 return o.ApplyT(func(v GetVpcIamPoolResult) bool { return v.AutoImport }).(pulumi.BoolOutput) 215 } 216 217 // 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. 218 func (o GetVpcIamPoolResultOutput) AwsService() pulumi.StringOutput { 219 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.AwsService }).(pulumi.StringOutput) 220 } 221 222 // Description for the IPAM pool. 223 func (o GetVpcIamPoolResultOutput) Description() pulumi.StringOutput { 224 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.Description }).(pulumi.StringOutput) 225 } 226 227 func (o GetVpcIamPoolResultOutput) Filters() GetVpcIamPoolFilterArrayOutput { 228 return o.ApplyT(func(v GetVpcIamPoolResult) []GetVpcIamPoolFilter { return v.Filters }).(GetVpcIamPoolFilterArrayOutput) 229 } 230 231 // ID of the IPAM pool. 232 func (o GetVpcIamPoolResultOutput) Id() pulumi.StringPtrOutput { 233 return o.ApplyT(func(v GetVpcIamPoolResult) *string { return v.Id }).(pulumi.StringPtrOutput) 234 } 235 236 func (o GetVpcIamPoolResultOutput) IpamPoolId() pulumi.StringPtrOutput { 237 return o.ApplyT(func(v GetVpcIamPoolResult) *string { return v.IpamPoolId }).(pulumi.StringPtrOutput) 238 } 239 240 // ID of the scope the pool belongs to. 241 func (o GetVpcIamPoolResultOutput) IpamScopeId() pulumi.StringOutput { 242 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.IpamScopeId }).(pulumi.StringOutput) 243 } 244 245 func (o GetVpcIamPoolResultOutput) IpamScopeType() pulumi.StringOutput { 246 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.IpamScopeType }).(pulumi.StringOutput) 247 } 248 249 // 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. 250 func (o GetVpcIamPoolResultOutput) Locale() pulumi.StringOutput { 251 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.Locale }).(pulumi.StringOutput) 252 } 253 254 func (o GetVpcIamPoolResultOutput) PoolDepth() pulumi.IntOutput { 255 return o.ApplyT(func(v GetVpcIamPoolResult) int { return v.PoolDepth }).(pulumi.IntOutput) 256 } 257 258 // Defines whether or not IPv6 pool space is publicly advertisable over the internet. 259 func (o GetVpcIamPoolResultOutput) PubliclyAdvertisable() pulumi.BoolOutput { 260 return o.ApplyT(func(v GetVpcIamPoolResult) bool { return v.PubliclyAdvertisable }).(pulumi.BoolOutput) 261 } 262 263 // ID of the source IPAM pool. 264 func (o GetVpcIamPoolResultOutput) SourceIpamPoolId() pulumi.StringOutput { 265 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.SourceIpamPoolId }).(pulumi.StringOutput) 266 } 267 268 func (o GetVpcIamPoolResultOutput) State() pulumi.StringOutput { 269 return o.ApplyT(func(v GetVpcIamPoolResult) string { return v.State }).(pulumi.StringOutput) 270 } 271 272 // Map of tags to assigned to the resource. 273 func (o GetVpcIamPoolResultOutput) Tags() pulumi.StringMapOutput { 274 return o.ApplyT(func(v GetVpcIamPoolResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 275 } 276 277 func init() { 278 pulumi.RegisterOutputType(GetVpcIamPoolResultOutput{}) 279 }