generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 271
Closed
aws-controllers-k8s/code-generator
#613Labels
area/adoption-annotationIssues or PRs related to ACK Adoption by Annotation featureIssues or PRs related to ACK Adoption by Annotation featureservice/lambdaIndicates issues or PRs that are related to lambda-controller.Indicates issues or PRs that are related to lambda-controller.
Description
Describe the bug
Lambda Alias resource cannot be adopted.
Steps to reproduce
Have an already existing Alias which we are trying to adopt:
$ aws lambda get-alias --function-name ethos103-dev-va6-cw2splunk --name ethos103-dev-va6-cw2splunk-alias --profile ethos-dev --region us-east-1
{
"AliasArn": "arn:aws:lambda:us-east-1:164592617289:function:ethos103-dev-va6-cw2splunk:ethos103-dev-va6-cw2splunk-alias",
"Name": "ethos103-dev-va6-cw2splunk-alias",
"FunctionVersion": "$LATEST",
"Description": "Lambda function alias triggered by CloudWatch Logs to export EKS ControlPlane",
"RevisionId": "be116060-aa0f-4ad8-b864-bf63d1ad23ac"
}
apiVersion: lambda.services.k8s.aws/v1alpha1
kind: Alias
metadata:
annotations:
services.k8s.aws/adoption-fields: |
{
"name": "ethos103-dev-va6-cw2splunk-alias"
}
services.k8s.aws/adoption-policy: adopt
Expected outcome
Expected outcome would have been the successful adoption of the resource.
The logs from the lambda ACK controller state otherwise:
{"level":"error","ts":"2025-07-15T11:47:24.169Z","msg":"Reconciler error","controller":"alias","controllerGroup":"lambda.services.k8s.aws","controllerKind":"Alias","Alias":{"name":"ethos103-dev-va6-cw2splunk-alias","namespace":"ethos103-dev-va6"},"namespace":"ethos103-dev-va6","name":"ethos103-dev-va6-cw2splunk-alias","reconcileID":"5c02adf1-36f0-4122-ba06-1653c87bdb32","error":"adopted resource not found","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:347\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:294\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:255"}
We were able to adopt a function in the same account, region, env.
We also have this policy that grants full rights over lambda service:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"lambda:*",
"s3:Get*",
"ecr:Get*",
"ecr:BatchGet*",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSubnets",
"ec2:DescribeVpcs"
],
"Resource": "*"
},
{
"Action": "iam:PassRole",
"Condition": {
"StringEquals": {
"iam:PassedToService": "lambda.amazonaws.com"
}
},
"Effect": "Allow",
"Resource": "*"
}
]
}
Environment
dev
- Kubernetes version: v1.31
- Using EKS (yes/no), if so version? yes, 1.31
- AWS service targeted (S3, RDS, etc.) Lambda
Metadata
Metadata
Assignees
Labels
area/adoption-annotationIssues or PRs related to ACK Adoption by Annotation featureIssues or PRs related to ACK Adoption by Annotation featureservice/lambdaIndicates issues or PRs that are related to lambda-controller.Indicates issues or PRs that are related to lambda-controller.