Skip to content

Commit

Permalink
Merge pull request #1430 from crossplane-contrib/backport-1429-to-rel…
Browse files Browse the repository at this point in the history
…ease-0.30

[Backport release-0.30] fix: Fixed generation of flowlog
  • Loading branch information
haarchri committed Aug 17, 2022
2 parents 67f59ae + 0bc8090 commit 6549c08
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 32 deletions.
2 changes: 1 addition & 1 deletion apis/ec2/generator-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ ignore:
- CreateFlowLogsInput.ResourceIds
- CreateFlowLogsInput.ResourceType
- CreateFlowLogsInput.TagSpecifications
- CreateFlowLogsInput.DeliverLogsPermissionARN
- CreateFlowLogsInput.DeliverLogsPermissionArn
- DescribeFlowLogsInput.FlowLogIds
- DescribeFlowLogsInput.DryRun
- CreateFlowLogsOutput.FlowLogIds
Expand Down
5 changes: 4 additions & 1 deletion apis/ec2/v1alpha1/custom_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,10 @@ type CustomFlowLogParameters struct {
// +optional
NetworkInterfaceID *string `json:"networkInterfaceId"`

// The Amazon Resource Names (ARNs) of an IAM Role.
// The ARN for the IAM role that permits Amazon EC2
// to publish flow logs to a CloudWatch Logs log group in your
// account. \n If you specify LogDestinationType as s3, do not
// specify DeliverLogsPermissionArn or LogGroupName.
// +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1.Role
// +crossplane:generate:reference:extractor=github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1.RoleARN()
DeliverLogsPermissionARN *string `json:"deliverLogsPermissionArn,omitempty"`
Expand Down
6 changes: 0 additions & 6 deletions apis/ec2/v1alpha1/zz_flow_log.go

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

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

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

9 changes: 3 additions & 6 deletions package/crds/ec2.aws.crossplane.io_flowlogs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,11 @@ spec:
type: string
type: object
type: object
deliverLogsPermissionARN:
description: "The ARN for the IAM role that permits Amazon EC2
deliverLogsPermissionArn:
description: The ARN for the IAM role that permits Amazon EC2
to publish flow logs to a CloudWatch Logs log group in your
account. \n If you specify LogDestinationType as s3, do not
specify DeliverLogsPermissionArn or LogGroupName."
type: string
deliverLogsPermissionArn:
description: The Amazon Resource Names (ARNs) of an IAM Role.
specify DeliverLogsPermissionArn or LogGroupName.
type: string
deliverLogsPermissionArnRef:
description: DeliverLogsPermissionARNRef is a reference to DeliverLogsPermissionARN
Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/ec2/flowlog/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ func preCreate(_ context.Context, cr *svcapitypes.FlowLog, obj *svcsdk.CreateFlo
obj.LogDestination = cr.Spec.ForProvider.CloudWatchLogDestination
}

if cr.Spec.ForProvider.DeliverLogsPermissionARN != nil {
obj.DeliverLogsPermissionArn = cr.Spec.ForProvider.DeliverLogsPermissionARN
}

if cr.Spec.ForProvider.Tags != nil {

obj.SetTagSpecifications(generateTagSpecifications(cr))
Expand Down
18 changes: 5 additions & 13 deletions pkg/controller/ec2/flowlog/zz_conversions.go

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

0 comments on commit 6549c08

Please sign in to comment.