Skip to content

Commit

Permalink
adjust vpc config
Browse files Browse the repository at this point in the history
Signed-off-by: Tung Huynh <[email protected]>
  • Loading branch information
huynhsontung committed Jun 22, 2023
1 parent 4bba500 commit 0648256
Show file tree
Hide file tree
Showing 8 changed files with 474 additions and 0 deletions.
40 changes: 40 additions & 0 deletions apis/vpc/v1beta1/zz_generated.deepcopy.go

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

64 changes: 64 additions & 0 deletions apis/vpc/v1beta1/zz_generated.resolvers.go

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

18 changes: 18 additions & 0 deletions apis/vpc/v1beta1/zz_securitygroupegressrule_types.go

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

18 changes: 18 additions & 0 deletions apis/vpc/v1beta1/zz_securitygroupingressrule_types.go

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

2 changes: 2 additions & 0 deletions config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ import (
"github.com/upbound/provider-aws/config/sns"
"github.com/upbound/provider-aws/config/sqs"
"github.com/upbound/provider-aws/config/transfer"
"github.com/upbound/provider-aws/config/vpc"
"github.com/upbound/provider-aws/hack"
)

Expand Down Expand Up @@ -226,6 +227,7 @@ func GetProvider() *config.Provider {
networkmanager.Configure,
opsworks.Configure,
sagemaker.Configure,
vpc.Configure,
} {
configure(pc)
}
Expand Down
36 changes: 36 additions & 0 deletions config/vpc/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2021 Upbound Inc.
*/

package vpc

import (
"github.com/upbound/upjet/pkg/config"
)

// Configure adds configurations for vpc group.
func Configure(p *config.Provider) {
p.AddResourceConfigurator("aws_vpc_security_group_ingress_rule", func(r *config.Resource) {
r.References["security_group_id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/ec2/v1beta1.SecurityGroup",
}
r.References["referenced_security_group_id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/ec2/v1beta1.SecurityGroup",
}
r.References["prefix_list_id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/ec2/v1beta1.ManagedPrefixList",
}
})

p.AddResourceConfigurator("aws_vpc_security_group_egress_rule", func(r *config.Resource) {
r.References["security_group_id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/ec2/v1beta1.SecurityGroup",
}
r.References["referenced_security_group_id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/ec2/v1beta1.SecurityGroup",
}
r.References["prefix_list_id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/ec2/v1beta1.ManagedPrefixList",
}
})
}
Loading

0 comments on commit 0648256

Please sign in to comment.