Skip to content

Commit

Permalink
Merge pull request #2003 from haooliveira84/sq-region
Browse files Browse the repository at this point in the history
feat(ec2/securitygroup)!: Make region a required field
  • Loading branch information
MisterMX committed Mar 19, 2024
2 parents 63b23e4 + c207bbf commit 432daeb
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
6 changes: 1 addition & 5 deletions apis/ec2/v1beta1/securitygroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@ import (
// SecurityGroupParameters define the desired state of an AWS VPC Security
// Group.
type SecurityGroupParameters struct {
// TODO(muvaf): Region is a required field but in order to keep backward compatibility
// with old Provider type and not bear the cost of bumping to v1beta2, we're
// keeping it optional for now. Reconsider before v1beta2 or v1.

// Region is the region you'd like your SecurityGroup to be created in.
// +optional
Region *string `json:"region,omitempty"`
Region string `json:"region"`

// A description of the security group.
// +immutable
Expand Down
5 changes: 0 additions & 5 deletions apis/ec2/v1beta1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions package/crds/ec2.aws.crossplane.io_securitygroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ spec:
required:
- description
- groupName
- region
type: object
managementPolicies:
default:
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/ec2/securitygroup/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (c *connector) Connect(ctx context.Context, mg resource.Managed) (managed.E
if !ok {
return nil, errors.New(errUnexpectedObject)
}
cfg, err := connectaws.GetConfig(ctx, c.kube, mg, aws.ToString(cr.Spec.ForProvider.Region))
cfg, err := connectaws.GetConfig(ctx, c.kube, mg, cr.Spec.ForProvider.Region)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 432daeb

Please sign in to comment.