Skip to content

copyLamdaFunction creating is failing when i try to deploy Data Lake in AWS

0

The CloudFormation stack Data-lake-foundation-DataLakeFoundationStack-IS67G4LRJQIU-ElasticsearchStack-YY9NNQARTKAR failed to create the resource [CopyLambdaDeployment] due to an error in the CloudWatch Logs. The error message reads: An error occurred (AccessDenied) when calling the CopyObject operation: Access Denied.

I attempted to resolve the issue by adding IAM permissions based on suggested solutions, but none of them worked. Below are the IAM permissions for the role being used.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:PutObject",
                "s3:ListBucket",
                "s3:CreateBucket",
                "s3:PutBucketPolicy",
                "s3:DeleteBucket",
                "s3:PutBucketNotification",
                "s3:PutBucketAcl",
                "s3:GetObjectTagging",
                "s3:PutObjectTagging",
                "s3:PutObjectAcl"
            ],
            "Resource": [
                "arn:aws:s3:::datalake-submissions/*",
                "arn:aws:s3:::datalake-curated-datasets/*",
                "arn:aws:s3:::datalake-published-data/*",
                "arn:aws:s3:::regional-lambda-bucket/*",
                "arn:aws:s3:::datalake-athena-query-results/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "kinesis:*",
                "kinesisanalytics:*",
                "lambda:*",
                "glue:*",
                "kinesis:CreateStream",
                "kinesis:DescribeStream",
                "kinesis:PutRecord",
                "kinesis:PutRecords",
                "lambda:CreateFunction",
                "lambda:UpdateFunctionCode",
                "lambda:UpdateFunctionConfiguration",
                "lambda:GetFunction",
                "lambda:DeleteFunction",
                "lambda:ListFunctions",
                "athena:*",
                "redshift:*",
                "quicksight:*",
                "sns:*",
                "sagemaker:*",
                "ec2:Describe*",
                "firehose:DescribeDeliveryStream",
                "firehose:ListDeliveryStreams",
                "firehose:PutRecord",
                "firehose:PutRecordBatch",
                "ec2:CreateLaunchTemplate",
                "ec2:DescribeLaunchTemplates",
                "ec2:RunInstances",
                "ec2:DescribeInstances",
                "ec2:CreateTags",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeSubnets",
                "ec2:DescribeVpcs",
                "ssm:GetParameters",
                "ssm:GetParameter",
                "ssm:DescribeParameters",
                "ec2:DeleteTags",
                "iam:CreateRole",
                "iam:AttachRolePolicy",
                "iam:PutRolePolicy",
                "iam:PassRole",
                "iam:DeleteRole",
                "ec2:CreateNetworkInterface",
                "ec2:DeleteNetworkInterface",
                "ec2:DescribeNetworkInterfaces",
                "ec2:AttachNetworkInterface",
                "ec2:DetachNetworkInterface",
                "elasticloadbalancing:*",
                "logs:*",
                "cloudformation:*",
                "cloudwatch:*",
                "es:*"
            ],
            "Resource": "*"
        }
    ]
}
1 Answer
1

I think the IAM role or Lambda function being used does not have the necessary permissions to perform the s3:CopyObject operation on the S3 bucket.

Make sure that the policy allows the required actions (e.g., s3:GetObject, s3:PutObject, s3:CopyObject) for the IAM role or Lambda function that is performing the action.

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.