Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add resource: aws_verifiedaccess_endpoint #30763

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/service/ec2/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const (
errCodeInvalidTransitGatewayPolicyTableIdNotFound = "InvalidTransitGatewayPolicyTableId.NotFound"
errCodeInvalidTransitGatewayIDNotFound = "InvalidTransitGatewayID.NotFound"
errCodeInvalidTransitGatewayMulticastDomainIdNotFound = "InvalidTransitGatewayMulticastDomainId.NotFound"
errCodeInvalidVerifiedAccessEndpointIdNotFound = "InvalidVerifiedAccessEndpointId.NotFound"
errCodeInvalidVolumeNotFound = "InvalidVolume.NotFound"
errCodeInvalidVPCCIDRBlockAssociationIDNotFound = "InvalidVpcCidrBlockAssociationID.NotFound"
errCodeInvalidVPCEndpointIdNotFound = "InvalidVpcEndpointId.NotFound"
Expand Down
20 changes: 20 additions & 0 deletions internal/service/ec2/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -2684,6 +2684,26 @@ func FindSubnetIPv6CIDRBlockAssociationByID(ctx context.Context, conn *ec2.EC2,
return nil, &retry.NotFoundError{}
}

func FindVerifiedAccessEndpointByID(ctx context.Context, conn *ec2.EC2, id string) (*ec2.VerifiedAccessEndpoint, error) {
in := &ec2.DescribeVerifiedAccessEndpointsInput{
VerifiedAccessEndpointIds: aws.StringSlice([]string{id}),
}
out, err := conn.DescribeVerifiedAccessEndpointsWithContext(ctx, in)

if tfawserr.ErrCodeEquals(err, errCodeInvalidVerifiedAccessEndpointIdNotFound) {
return nil, &retry.NotFoundError{
LastError: err,
LastRequest: in,
}
}

if err != nil {
return nil, err
}

return out.VerifiedAccessEndpoints[0], nil
}

func FindVolumeModifications(ctx context.Context, conn *ec2.EC2, input *ec2.DescribeVolumesModificationsInput) ([]*ec2.VolumeModification, error) {
var output []*ec2.VolumeModification

Expand Down
8 changes: 8 additions & 0 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.

16 changes: 16 additions & 0 deletions internal/service/ec2/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -1414,3 +1414,19 @@ func StatusIPAMScopeState(ctx context.Context, conn *ec2.EC2, id string) retry.S
return output, aws.StringValue(output.State), nil
}
}

func StatusVerifiedAccessEndpoint(ctx context.Context, conn *ec2.EC2, id string) retry.StateRefreshFunc {
return func() (interface{}, string, error) {
out, err := FindVerifiedAccessEndpointByID(ctx, conn, id)

if tfresource.NotFound(err) {
return nil, "xx", nil
}

if err != nil {
return nil, "XX", err
}

return out, aws.StringValue(out.Status.Code), nil
}
}
Loading