Skip to content

Commit

Permalink
Move lambda/v1beat1.LambdaFunctionInvokeARN to common/apis.LambdaFunc…
Browse files Browse the repository at this point in the history
…tionInvokeARN to prevent circlular imports.

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
  • Loading branch information
ulucinar committed Jan 17, 2024
1 parent 354d8d3 commit 6c24e4b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apis/apigatewayv2/v1beta1/zz_authorizer_types.go

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

5 changes: 3 additions & 2 deletions apis/apigatewayv2/v1beta1/zz_generated.resolvers.go

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

4 changes: 2 additions & 2 deletions config/apigatewayv2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func Configure(p *config.Provider) {
Type: "API",
}
r.References["authorizer_uri"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/lambda/v1beta1.Function",
Extractor: "github.com/upbound/provider-aws/apis/lambda/v1beta1.LambdaFunctionInvokeARN()",
TerraformName: "aws_lambda_function",
Extractor: "github.com/upbound/provider-aws/config/common/apis.LambdaFunctionInvokeARN()",
}
})
p.AddResourceConfigurator("aws_apigatewayv2_domain_name", func(r *config.Resource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
Copyright 2022 Upbound Inc.
*/

package v1beta1
package apis

import (
"github.com/crossplane/crossplane-runtime/pkg/reference"
xpresource "github.com/crossplane/crossplane-runtime/pkg/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/upbound/provider-aws/apis/lambda/v1beta1"
)

// LambdaFunctionInvokeARN returns the invoke ARN value of the lambda function.
func LambdaFunctionInvokeARN() reference.ExtractValueFn {
return func(mg xpresource.Managed) string {
return func(mg metav1.Object) string {
f, ok := mg.(*Function)
f, ok := mg.(*v1beta1.Function)
if !ok {
return ""
}
Expand Down

0 comments on commit 6c24e4b

Please sign in to comment.