github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getVpcEndpoint.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 // The VPC Endpoint data source provides details about 15 // a specific VPC endpoint. 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/ec2" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // // Declare the data source 33 // s3, err := ec2.LookupVpcEndpoint(ctx, &ec2.LookupVpcEndpointArgs{ 34 // VpcId: pulumi.StringRef(foo.Id), 35 // ServiceName: pulumi.StringRef("com.amazonaws.us-west-2.s3"), 36 // }, nil) 37 // if err != nil { 38 // return err 39 // } 40 // _, err = ec2.NewVpcEndpointRouteTableAssociation(ctx, "private_s3", &ec2.VpcEndpointRouteTableAssociationArgs{ 41 // VpcEndpointId: pulumi.String(s3.Id), 42 // RouteTableId: pulumi.Any(private.Id), 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // return nil 48 // }) 49 // } 50 // 51 // ``` 52 // <!--End PulumiCodeChooser --> 53 func LookupVpcEndpoint(ctx *pulumi.Context, args *LookupVpcEndpointArgs, opts ...pulumi.InvokeOption) (*LookupVpcEndpointResult, error) { 54 opts = internal.PkgInvokeDefaultOpts(opts) 55 var rv LookupVpcEndpointResult 56 err := ctx.Invoke("aws:ec2/getVpcEndpoint:getVpcEndpoint", args, &rv, opts...) 57 if err != nil { 58 return nil, err 59 } 60 return &rv, nil 61 } 62 63 // A collection of arguments for invoking getVpcEndpoint. 64 type LookupVpcEndpointArgs struct { 65 // Custom filter block as described below. 66 Filters []GetVpcEndpointFilter `pulumi:"filters"` 67 // ID of the specific VPC Endpoint to retrieve. 68 Id *string `pulumi:"id"` 69 // Service name of the specific VPC Endpoint to retrieve. For AWS services the service name is usually in the form `com.amazonaws.<region>.<service>` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker.<region>.notebook`). 70 ServiceName *string `pulumi:"serviceName"` 71 // State of the specific VPC Endpoint to retrieve. 72 State *string `pulumi:"state"` 73 // Map of tags, each pair of which must exactly match 74 // a pair on the specific VPC Endpoint to retrieve. 75 Tags map[string]string `pulumi:"tags"` 76 // ID of the VPC in which the specific VPC Endpoint is used. 77 // 78 // More complex filters can be expressed using one or more `filter` sub-blocks, 79 // which take the following arguments: 80 VpcId *string `pulumi:"vpcId"` 81 } 82 83 // A collection of values returned by getVpcEndpoint. 84 type LookupVpcEndpointResult struct { 85 // ARN of the VPC endpoint. 86 Arn string `pulumi:"arn"` 87 // List of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `Gateway`. 88 CidrBlocks []string `pulumi:"cidrBlocks"` 89 // DNS entries for the VPC Endpoint. Applicable for endpoints of type `Interface`. DNS entry blocks are documented below. 90 DnsEntries []GetVpcEndpointDnsEntry `pulumi:"dnsEntries"` 91 // DNS options for the VPC Endpoint. DNS options blocks are documented below. 92 DnsOptions []GetVpcEndpointDnsOption `pulumi:"dnsOptions"` 93 Filters []GetVpcEndpointFilter `pulumi:"filters"` 94 Id string `pulumi:"id"` 95 IpAddressType string `pulumi:"ipAddressType"` 96 // One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `Interface`. 97 NetworkInterfaceIds []string `pulumi:"networkInterfaceIds"` 98 // ID of the AWS account that owns the VPC endpoint. 99 OwnerId string `pulumi:"ownerId"` 100 // Policy document associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`. 101 Policy string `pulumi:"policy"` 102 // Prefix list ID of the exposed AWS service. Applicable for endpoints of type `Gateway`. 103 PrefixListId string `pulumi:"prefixListId"` 104 // Whether or not the VPC is associated with a private hosted zone - `true` or `false`. Applicable for endpoints of type `Interface`. 105 PrivateDnsEnabled bool `pulumi:"privateDnsEnabled"` 106 // Whether or not the VPC Endpoint is being managed by its service - `true` or `false`. 107 RequesterManaged bool `pulumi:"requesterManaged"` 108 // One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`. 109 RouteTableIds []string `pulumi:"routeTableIds"` 110 // One or more security groups associated with the network interfaces. Applicable for endpoints of type `Interface`. 111 SecurityGroupIds []string `pulumi:"securityGroupIds"` 112 ServiceName string `pulumi:"serviceName"` 113 State string `pulumi:"state"` 114 // One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type `Interface`. 115 SubnetIds []string `pulumi:"subnetIds"` 116 Tags map[string]string `pulumi:"tags"` 117 // VPC Endpoint type, `Gateway` or `Interface`. 118 VpcEndpointType string `pulumi:"vpcEndpointType"` 119 VpcId string `pulumi:"vpcId"` 120 } 121 122 func LookupVpcEndpointOutput(ctx *pulumi.Context, args LookupVpcEndpointOutputArgs, opts ...pulumi.InvokeOption) LookupVpcEndpointResultOutput { 123 return pulumi.ToOutputWithContext(context.Background(), args). 124 ApplyT(func(v interface{}) (LookupVpcEndpointResult, error) { 125 args := v.(LookupVpcEndpointArgs) 126 r, err := LookupVpcEndpoint(ctx, &args, opts...) 127 var s LookupVpcEndpointResult 128 if r != nil { 129 s = *r 130 } 131 return s, err 132 }).(LookupVpcEndpointResultOutput) 133 } 134 135 // A collection of arguments for invoking getVpcEndpoint. 136 type LookupVpcEndpointOutputArgs struct { 137 // Custom filter block as described below. 138 Filters GetVpcEndpointFilterArrayInput `pulumi:"filters"` 139 // ID of the specific VPC Endpoint to retrieve. 140 Id pulumi.StringPtrInput `pulumi:"id"` 141 // Service name of the specific VPC Endpoint to retrieve. For AWS services the service name is usually in the form `com.amazonaws.<region>.<service>` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker.<region>.notebook`). 142 ServiceName pulumi.StringPtrInput `pulumi:"serviceName"` 143 // State of the specific VPC Endpoint to retrieve. 144 State pulumi.StringPtrInput `pulumi:"state"` 145 // Map of tags, each pair of which must exactly match 146 // a pair on the specific VPC Endpoint to retrieve. 147 Tags pulumi.StringMapInput `pulumi:"tags"` 148 // ID of the VPC in which the specific VPC Endpoint is used. 149 // 150 // More complex filters can be expressed using one or more `filter` sub-blocks, 151 // which take the following arguments: 152 VpcId pulumi.StringPtrInput `pulumi:"vpcId"` 153 } 154 155 func (LookupVpcEndpointOutputArgs) ElementType() reflect.Type { 156 return reflect.TypeOf((*LookupVpcEndpointArgs)(nil)).Elem() 157 } 158 159 // A collection of values returned by getVpcEndpoint. 160 type LookupVpcEndpointResultOutput struct{ *pulumi.OutputState } 161 162 func (LookupVpcEndpointResultOutput) ElementType() reflect.Type { 163 return reflect.TypeOf((*LookupVpcEndpointResult)(nil)).Elem() 164 } 165 166 func (o LookupVpcEndpointResultOutput) ToLookupVpcEndpointResultOutput() LookupVpcEndpointResultOutput { 167 return o 168 } 169 170 func (o LookupVpcEndpointResultOutput) ToLookupVpcEndpointResultOutputWithContext(ctx context.Context) LookupVpcEndpointResultOutput { 171 return o 172 } 173 174 // ARN of the VPC endpoint. 175 func (o LookupVpcEndpointResultOutput) Arn() pulumi.StringOutput { 176 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.Arn }).(pulumi.StringOutput) 177 } 178 179 // List of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `Gateway`. 180 func (o LookupVpcEndpointResultOutput) CidrBlocks() pulumi.StringArrayOutput { 181 return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.CidrBlocks }).(pulumi.StringArrayOutput) 182 } 183 184 // DNS entries for the VPC Endpoint. Applicable for endpoints of type `Interface`. DNS entry blocks are documented below. 185 func (o LookupVpcEndpointResultOutput) DnsEntries() GetVpcEndpointDnsEntryArrayOutput { 186 return o.ApplyT(func(v LookupVpcEndpointResult) []GetVpcEndpointDnsEntry { return v.DnsEntries }).(GetVpcEndpointDnsEntryArrayOutput) 187 } 188 189 // DNS options for the VPC Endpoint. DNS options blocks are documented below. 190 func (o LookupVpcEndpointResultOutput) DnsOptions() GetVpcEndpointDnsOptionArrayOutput { 191 return o.ApplyT(func(v LookupVpcEndpointResult) []GetVpcEndpointDnsOption { return v.DnsOptions }).(GetVpcEndpointDnsOptionArrayOutput) 192 } 193 194 func (o LookupVpcEndpointResultOutput) Filters() GetVpcEndpointFilterArrayOutput { 195 return o.ApplyT(func(v LookupVpcEndpointResult) []GetVpcEndpointFilter { return v.Filters }).(GetVpcEndpointFilterArrayOutput) 196 } 197 198 func (o LookupVpcEndpointResultOutput) Id() pulumi.StringOutput { 199 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.Id }).(pulumi.StringOutput) 200 } 201 202 func (o LookupVpcEndpointResultOutput) IpAddressType() pulumi.StringOutput { 203 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.IpAddressType }).(pulumi.StringOutput) 204 } 205 206 // One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `Interface`. 207 func (o LookupVpcEndpointResultOutput) NetworkInterfaceIds() pulumi.StringArrayOutput { 208 return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.NetworkInterfaceIds }).(pulumi.StringArrayOutput) 209 } 210 211 // ID of the AWS account that owns the VPC endpoint. 212 func (o LookupVpcEndpointResultOutput) OwnerId() pulumi.StringOutput { 213 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.OwnerId }).(pulumi.StringOutput) 214 } 215 216 // Policy document associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`. 217 func (o LookupVpcEndpointResultOutput) Policy() pulumi.StringOutput { 218 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.Policy }).(pulumi.StringOutput) 219 } 220 221 // Prefix list ID of the exposed AWS service. Applicable for endpoints of type `Gateway`. 222 func (o LookupVpcEndpointResultOutput) PrefixListId() pulumi.StringOutput { 223 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.PrefixListId }).(pulumi.StringOutput) 224 } 225 226 // Whether or not the VPC is associated with a private hosted zone - `true` or `false`. Applicable for endpoints of type `Interface`. 227 func (o LookupVpcEndpointResultOutput) PrivateDnsEnabled() pulumi.BoolOutput { 228 return o.ApplyT(func(v LookupVpcEndpointResult) bool { return v.PrivateDnsEnabled }).(pulumi.BoolOutput) 229 } 230 231 // Whether or not the VPC Endpoint is being managed by its service - `true` or `false`. 232 func (o LookupVpcEndpointResultOutput) RequesterManaged() pulumi.BoolOutput { 233 return o.ApplyT(func(v LookupVpcEndpointResult) bool { return v.RequesterManaged }).(pulumi.BoolOutput) 234 } 235 236 // One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`. 237 func (o LookupVpcEndpointResultOutput) RouteTableIds() pulumi.StringArrayOutput { 238 return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.RouteTableIds }).(pulumi.StringArrayOutput) 239 } 240 241 // One or more security groups associated with the network interfaces. Applicable for endpoints of type `Interface`. 242 func (o LookupVpcEndpointResultOutput) SecurityGroupIds() pulumi.StringArrayOutput { 243 return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput) 244 } 245 246 func (o LookupVpcEndpointResultOutput) ServiceName() pulumi.StringOutput { 247 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.ServiceName }).(pulumi.StringOutput) 248 } 249 250 func (o LookupVpcEndpointResultOutput) State() pulumi.StringOutput { 251 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.State }).(pulumi.StringOutput) 252 } 253 254 // One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type `Interface`. 255 func (o LookupVpcEndpointResultOutput) SubnetIds() pulumi.StringArrayOutput { 256 return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.SubnetIds }).(pulumi.StringArrayOutput) 257 } 258 259 func (o LookupVpcEndpointResultOutput) Tags() pulumi.StringMapOutput { 260 return o.ApplyT(func(v LookupVpcEndpointResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 261 } 262 263 // VPC Endpoint type, `Gateway` or `Interface`. 264 func (o LookupVpcEndpointResultOutput) VpcEndpointType() pulumi.StringOutput { 265 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.VpcEndpointType }).(pulumi.StringOutput) 266 } 267 268 func (o LookupVpcEndpointResultOutput) VpcId() pulumi.StringOutput { 269 return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.VpcId }).(pulumi.StringOutput) 270 } 271 272 func init() { 273 pulumi.RegisterOutputType(LookupVpcEndpointResultOutput{}) 274 }