Getting information about a service connection
Warning
The VPC Private Endpoints feature is at the Preview stage. To request access to the feature, contact your account manager.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
View the description of the CLI command to get information about a service connection (private endpoint):
yc vpc private-endpoint get --help -
Get information about a service connection by specifying its name or ID:
yc vpc private-endpoint get <service_connection_ID>Result:
id: enpd7*************** folder_id: b1g23*************** created_at: "2024-08-31T16:23:33.859574Z" name: s3-vpc-link description: Private Endpoint to the Object Storage network_id: enpgi*************** status: AVAILABLE address: subnet_id: e2l8b*************** address: 10.128.0.10 address_id: e2ldn*************** dns_options: {} object_storage: {}
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To get information about a service connection through Terraform:
-
Add the
dataandoutputsections to the Terraform configuration file:data "yandex_vpc_private_endpoint" "my-vpc-data" { private_endpoint_id = "<service_connection_ID>" } output "endpoint-info-network" { value = data.yandex_vpc_private_endpoint.my-vpc-info.network_id }Where:
data "yandex_vpc_private_endpoint": Description of the service connection as a data source:resource_id: Service connection ID.
output "ref_description": Output variable storing the service connection's network ID (network_id):value: Return value.
You can replace
network_idwith any other parameter to get the information you need. For more information about theyandex_vpc_private_endpointdata source parameters, see the relevant provider documentation. -
Create the resources:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
Terraform will create the required resources and display their output variables. To check the results, run this command:
terraform outputResult:
endpoint-info-network = "enpt232s2lp6********" -
To get information about a service connection, use the get REST API method for the PrivateEndpoint resource or the PrivateEndpointService/Get gRPC API call.