Skip to content

Commit

Permalink
Bump uptest version and revert externalname changes
Browse files Browse the repository at this point in the history
Signed-off-by: Fatih Türken <[email protected]>
  • Loading branch information
turkenf committed Oct 10, 2023
1 parent 7f9a972 commit da9dbaa
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export SUBPACKAGES := $(SUBPACKAGES)
KIND_VERSION = v0.15.0
UP_VERSION = v0.17.0
UP_CHANNEL = stable
UPTEST_VERSION = v0.6.0
UPTEST_VERSION = v0.6.1

export UP_VERSION := $(UP_VERSION)
export UP_CHANNEL := $(UP_CHANNEL)
Expand Down
18 changes: 9 additions & 9 deletions apis/ec2/v1beta1/zz_securitygroupegressrule_types.go

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

18 changes: 9 additions & 9 deletions apis/ec2/v1beta1/zz_securitygroupingressrule_types.go

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

12 changes: 6 additions & 6 deletions config/ec2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,26 +220,26 @@ func Configure(p *config.Provider) {
p.AddResourceConfigurator("aws_vpc_security_group_ingress_rule", func(r *config.Resource) {
r.Kind = "SecurityGroupIngressRule"
r.References["security_group_id"] = config.Reference{
Type: "SecurityGroup",
TerraformName: "aws_security_group",
}
r.References["referenced_security_group_id"] = config.Reference{
Type: "SecurityGroup",
TerraformName: "aws_security_group",
}
r.References["prefix_list_id"] = config.Reference{
Type: "ManagedPrefixList",
TerraformName: "aws_ec2_managed_prefix_list",
}
})

p.AddResourceConfigurator("aws_vpc_security_group_egress_rule", func(r *config.Resource) {
r.Kind = "SecurityGroupEgressRule"
r.References["security_group_id"] = config.Reference{
Type: "SecurityGroup",
TerraformName: "aws_security_group",
}
r.References["referenced_security_group_id"] = config.Reference{
Type: "SecurityGroup",
TerraformName: "aws_security_group",
}
r.References["prefix_list_id"] = config.Reference{
Type: "ManagedPrefixList",
TerraformName: "aws_ec2_managed_prefix_list",
}
})

Expand Down
17 changes: 15 additions & 2 deletions config/externalname.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ var ExternalNameConfigs = map[string]config.ExternalName{
// https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule
"aws_security_group_rule": config.IdentifierFromProvider,
// Imported by using the id: sgr-02108b27edd666983
"aws_vpc_security_group_egress_rule": config.IdentifierFromProvider,
"aws_vpc_security_group_egress_rule": vpcSecurityGroupRule(),
// Imported by using the id: sgr-02108b27edd666983
"aws_vpc_security_group_ingress_rule": config.IdentifierFromProvider,
"aws_vpc_security_group_ingress_rule": vpcSecurityGroupRule(),
// Imported by using the VPC CIDR Association ID: vpc-cidr-assoc-xxxxxxxx
"aws_vpc_ipv4_cidr_block_association": config.IdentifierFromProvider,
// Imported using the vpc peering id: pcx-111aaa111
Expand Down Expand Up @@ -2735,6 +2735,19 @@ func kmsAlias() config.ExternalName {
return e
}

func vpcSecurityGroupRule() config.ExternalName {
// Terraform does not allow security group rule id to be empty.
// Using a stub value to pass validation.
e := config.IdentifierFromProvider
e.GetIDFn = func(_ context.Context, externalName string, _ map[string]any, _ map[string]any) (string, error) {
if len(externalName) == 0 {
return "sgr-stub", nil
}
return externalName, nil
}
return e
}

func route() config.ExternalName {
e := config.IdentifierFromProvider
e.GetIDFn = func(_ context.Context, _ string, parameters map[string]interface{}, _ map[string]interface{}) (string, error) {
Expand Down
14 changes: 8 additions & 6 deletions package/crds/ec2.aws.upbound.io_securitygroupegressrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ spec:
description: The ID of the destination prefix list.
type: string
prefixListIdRef:
description: Reference to a ManagedPrefixList to populate prefixListId.
description: Reference to a ManagedPrefixList in ec2 to populate
prefixListId.
properties:
name:
description: Name of the referenced object.
Expand Down Expand Up @@ -123,7 +124,8 @@ spec:
- name
type: object
prefixListIdSelector:
description: Selector for a ManagedPrefixList to populate prefixListId.
description: Selector for a ManagedPrefixList in ec2 to populate
prefixListId.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
Expand Down Expand Up @@ -166,7 +168,7 @@ spec:
in the rule.
type: string
referencedSecurityGroupIdRef:
description: Reference to a SecurityGroup to populate referencedSecurityGroupId.
description: Reference to a SecurityGroup in ec2 to populate referencedSecurityGroupId.
properties:
name:
description: Name of the referenced object.
Expand Down Expand Up @@ -200,7 +202,7 @@ spec:
- name
type: object
referencedSecurityGroupIdSelector:
description: Selector for a SecurityGroup to populate referencedSecurityGroupId.
description: Selector for a SecurityGroup in ec2 to populate referencedSecurityGroupId.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
Expand Down Expand Up @@ -246,7 +248,7 @@ spec:
description: The ID of the security group.
type: string
securityGroupIdRef:
description: Reference to a SecurityGroup to populate securityGroupId.
description: Reference to a SecurityGroup in ec2 to populate securityGroupId.
properties:
name:
description: Name of the referenced object.
Expand Down Expand Up @@ -280,7 +282,7 @@ spec:
- name
type: object
securityGroupIdSelector:
description: Selector for a SecurityGroup to populate securityGroupId.
description: Selector for a SecurityGroup in ec2 to populate securityGroupId.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
Expand Down
14 changes: 8 additions & 6 deletions package/crds/ec2.aws.upbound.io_securitygroupingressrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ spec:
description: The ID of the source prefix list.
type: string
prefixListIdRef:
description: Reference to a ManagedPrefixList to populate prefixListId.
description: Reference to a ManagedPrefixList in ec2 to populate
prefixListId.
properties:
name:
description: Name of the referenced object.
Expand Down Expand Up @@ -123,7 +124,8 @@ spec:
- name
type: object
prefixListIdSelector:
description: Selector for a ManagedPrefixList to populate prefixListId.
description: Selector for a ManagedPrefixList in ec2 to populate
prefixListId.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
Expand Down Expand Up @@ -166,7 +168,7 @@ spec:
rule.
type: string
referencedSecurityGroupIdRef:
description: Reference to a SecurityGroup to populate referencedSecurityGroupId.
description: Reference to a SecurityGroup in ec2 to populate referencedSecurityGroupId.
properties:
name:
description: Name of the referenced object.
Expand Down Expand Up @@ -200,7 +202,7 @@ spec:
- name
type: object
referencedSecurityGroupIdSelector:
description: Selector for a SecurityGroup to populate referencedSecurityGroupId.
description: Selector for a SecurityGroup in ec2 to populate referencedSecurityGroupId.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
Expand Down Expand Up @@ -246,7 +248,7 @@ spec:
description: The ID of the security group.
type: string
securityGroupIdRef:
description: Reference to a SecurityGroup to populate securityGroupId.
description: Reference to a SecurityGroup in ec2 to populate securityGroupId.
properties:
name:
description: Name of the referenced object.
Expand Down Expand Up @@ -280,7 +282,7 @@ spec:
- name
type: object
securityGroupIdSelector:
description: Selector for a SecurityGroup to populate securityGroupId.
description: Selector for a SecurityGroup in ec2 to populate securityGroupId.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
Expand Down

0 comments on commit da9dbaa

Please sign in to comment.