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 installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
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, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the 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.