Skip to content

Add resource references #40

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

Merged
merged 1 commit into from
Mar 15, 2022
Merged
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
10 changes: 5 additions & 5 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2022-03-02T19:07:54Z"
build_hash: ade2429bb444ab635916395ea5773d141ba135e1
go_version: go1.17.5
build_date: "2022-03-14T23:35:32Z"
build_hash: 00cd850c16117752abe18558326a508436565b1a
go_version: go1.17.8
version: v0.17.2
api_directory_checksum: ad688fd5a2b395bf5f01413c99ac635e7670ba75
api_directory_checksum: 45311575b1cf56326ccad9a2caea143fc104b630
api_version: v1alpha1
aws_sdk_go_version: v1.42.0
generator_config_info:
file_checksum: cdc6db8f7b924d8b14a4926f0bb937b7952b102f
file_checksum: b588c7e44229d7db3737b17b76a68708c71e5b68
original_file_name: generator.yaml
last_modification:
reason: API generation
29 changes: 29 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ resources:
Routes:
custom_field:
list_of: CreateRouteInput
VpcId:
references:
resource: VPC
path: Status.VPCID
hooks:
sdk_create_post_set_output:
template_path: hooks/route_table/sdk_create_post_set_output.go.tpl
Expand All @@ -134,6 +138,9 @@ resources:
is_primary_key: true
VpcId:
is_required: true
references:
resource: VPC
path: Status.VPCID
renames:
operations:
CreateSecurityGroup:
Expand All @@ -155,11 +162,33 @@ resources:
- InvalidVpcID.NotFound
- VPCIdNotSpecified
Subnet:
fields:
VpcId:
references:
resource: VPC
path: Status.VPCID
exceptions:
terminal_codes:
- InvalidVpcID.Malformed
- InvalidVpcID.NotFound
VpcEndpoint:
fields:
VpcId:
references:
resource: VPC
path: Status.VPCID
RouteTableIds:
references:
resource: RouteTable
path: Status.RouteTableID
SecurityGroupIds:
references:
resource: SecurityGroup
path: Status.ID
SubnetIds:
references:
resource: Subnet
path: Status.SubnetID
exceptions:
terminal_codes:
- InvalidVpcId.Malformed
Expand Down
4 changes: 2 additions & 2 deletions apis/v1alpha1/route_table.go

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

4 changes: 2 additions & 2 deletions apis/v1alpha1/security_group.go

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

4 changes: 2 additions & 2 deletions apis/v1alpha1/subnet.go

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

13 changes: 8 additions & 5 deletions apis/v1alpha1/vpc_endpoint.go

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

53 changes: 53 additions & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

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

16 changes: 14 additions & 2 deletions config/crd/bases/ec2.services.k8s.aws_routetables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,20 @@ spec:
vpcID:
description: The ID of the VPC.
type: string
required:
- vpcID
vpcRef:
description: 'AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using ''from'' field Ex: APIIDRef: from: name:
my-api'
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
type: object
status:
description: RouteTableStatus defines the observed state of RouteTable
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/ec2.services.k8s.aws_securitygroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,23 @@ spec:
vpcID:
description: '[EC2-VPC] The ID of the VPC. Required for EC2-VPC.'
type: string
vpcRef:
description: 'AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using ''from'' field Ex: APIIDRef: from: name:
my-api'
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
required:
- description
- name
- vpcID
type: object
status:
description: SecurityGroupStatus defines the observed state of SecurityGroup
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/ec2.services.k8s.aws_subnets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,22 @@ spec:
vpcID:
description: The ID of the VPC.
type: string
vpcRef:
description: 'AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using ''from'' field Ex: APIIDRef: from: name:
my-api'
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
required:
- cidrBlock
- vpcID
type: object
status:
description: SubnetStatus defines the observed state of Subnet
Expand Down
Loading