@@ -35,7 +35,6 @@ use Exporter 'import';
3535use testapi;
3636
3737our @EXPORT = qw(
38- qesap_aws_get_vpc_id
3938 qesap_aws_get_tgw_attachments
4039 qesap_aws_delete_transit_gateway_vpc_attachment
4140 qesap_aws_create_credentials
@@ -96,41 +95,6 @@ sub qesap_aws_create_config {
9695 assert_script_run ' curl ' . autoinst_url . " /files/config -o ~/.aws/config" ;
9796}
9897
99- =head3 qesap_aws_get_vpc_id
100-
101- Get the vpc_id of a given instance in the cluster.
102- This function looks for the cluster using the aws describe-instances
103- and filtering by terraform deployment_name value, that qe-sap-deployment
104- is kind to use as tag for each resource.
105-
106- =cut
107-
108- =over
109-
110- =item B<RESOURCE_GROUP > - value of the workspace tag configured in qe-sap-deployment, usually it is the deployment name
111-
112- =back
113- =cut
114-
115- sub qesap_aws_get_vpc_id {
116- my (%args ) = @_ ;
117- croak ' Missing mandatory resource_group argument' unless $args {resource_group };
118-
119- # tag names has to be aligned to
120- # https://github.com/SUSE/qe-sap-deployment/blob/main/terraform/aws/infrastructure.tf
121- my $cmd = join (' ' , ' aws ec2 describe-instances' ,
122- ' --region' , get_required_var(' PUBLIC_CLOUD_REGION' ),
123- ' --filters' ,
124- ' "Name=tag-key,Values=workspace"' ,
125- " \" Name=tag-value,Values=$args {resource_group}\" " ,
126- ' --query' ,
127- # the two 0 index result in select only the vpc of vmhana01
128- # that is always equal to the one used by vmhana02
129- " 'Reservations[0].Instances[0].VpcId'" ,
130- ' --output text' );
131- return script_output($cmd );
132- }
133-
13498=head3 qesap_aws_get_transit_gateway_vpc_attachment
13599 Ged a description of one or more transit-gateway-attachments
136100 Function support optional arguments that are translated to filters:
0 commit comments