Skip to content

Commit

Permalink
vpnclient: Reduce visibility -- resources and data sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed May 20, 2024
1 parent f4961ef commit ba8f433
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
4 changes: 4 additions & 0 deletions internal/service/ec2/exports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ package ec2

// Exports for use in tests only.
var (
ResourceClientVPNAuthorizationRule = resourceClientVPNAuthorizationRule
ResourceClientVPNEndpoint = resourceClientVPNEndpoint
ResourceClientVPNNetworkAssociation = resourceClientVPNNetworkAssociation
ResourceClientVPNRoute = resourceClientVPNRoute
ResourceCustomerGateway = resourceCustomerGateway
ResourceDefaultNetworkACL = resourceDefaultNetworkACL
ResourceDefaultRouteTable = resourceDefaultRouteTable
Expand Down
12 changes: 7 additions & 5 deletions internal/service/ec2/service_package_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/service/ec2/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ func sweepClientVPNEndpoints(region string) error {
}

for _, v := range page.ClientVpnEndpoints {
r := ResourceClientVPNEndpoint()
r := resourceClientVPNEndpoint()
d := r.Data(nil)
d.SetId(aws.StringValue(v.ClientVpnEndpointId))

Expand Down Expand Up @@ -619,7 +619,7 @@ func sweepClientVPNNetworkAssociations(region string) error {
}

for _, v := range page.ClientVpnTargetNetworks {
r := ResourceClientVPNNetworkAssociation()
r := resourceClientVPNNetworkAssociation()
d := r.Data(nil)
d.SetId(aws.StringValue(v.AssociationId))
d.Set("client_vpn_endpoint_id", v.ClientVpnEndpointId)
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpnclient_authorization_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

// @SDKResource("aws_ec2_client_vpn_authorization_rule", name="Client VPN Authorization Rule")
func ResourceClientVPNAuthorizationRule() *schema.Resource {
func resourceClientVPNAuthorizationRule() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceClientVPNAuthorizationRuleCreate,
ReadWithoutTimeout: resourceClientVPNAuthorizationRuleRead,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpnclient_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

// @SDKResource("aws_ec2_client_vpn_endpoint", name="Client VPN Endpoint")
// @Tags(identifierAttribute="id")
func ResourceClientVPNEndpoint() *schema.Resource {
func resourceClientVPNEndpoint() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceClientVPNEndpointCreate,
ReadWithoutTimeout: resourceClientVPNEndpointRead,
Expand Down
10 changes: 4 additions & 6 deletions internal/service/ec2/vpnclient_endpoint_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import (
"github.com/hashicorp/terraform-provider-aws/names"
)

// @SDKDataSource("aws_ec2_client_vpn_endpoint")
func DataSourceClientVPNEndpoint() *schema.Resource {
// @SDKDataSource("aws_ec2_client_vpn_endpoint", name="Client VPN Endpoint")
// @Tags
func dataSourceClientVPNEndpoint() *schema.Resource {
return &schema.Resource{
ReadWithoutTimeout: dataSourceClientVPNEndpointRead,

Expand Down Expand Up @@ -183,7 +184,6 @@ func DataSourceClientVPNEndpoint() *schema.Resource {
func dataSourceClientVPNEndpointRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Client(ctx)
ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig

input := &ec2.DescribeClientVpnEndpointsInput{}

Expand Down Expand Up @@ -261,9 +261,7 @@ func dataSourceClientVPNEndpointRead(ctx context.Context, d *schema.ResourceData
d.Set(names.AttrVPCID, ep.VpcId)
d.Set("vpn_port", ep.VpnPort)

if err := d.Set(names.AttrTags, keyValueTagsV2(ctx, ep.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil {
return sdkdiag.AppendErrorf(diags, "setting tags: %s", err)
}
setTagsOutV2(ctx, ep.Tags)

return diags
}
2 changes: 1 addition & 1 deletion internal/service/ec2/vpnclient_network_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

// @SDKResource("aws_ec2_client_vpn_network_association", name="Client VPN Network Association")
func ResourceClientVPNNetworkAssociation() *schema.Resource {
func resourceClientVPNNetworkAssociation() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceClientVPNNetworkAssociationCreate,
ReadWithoutTimeout: resourceClientVPNNetworkAssociationRead,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpnclient_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

// @SDKResource("aws_ec2_client_vpn_route", name="Client VPN Route")
func ResourceClientVPNRoute() *schema.Resource {
func resourceClientVPNRoute() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceClientVPNRouteCreate,
ReadWithoutTimeout: resourceClientVPNRouteRead,
Expand Down

0 comments on commit ba8f433

Please sign in to comment.