Questions tagged with Developer Tools

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Lambda deploy from Eclipse not working: AWS ResourceConflictException

Hello, Please see below the steps that return an AWS error in local Eclipse: - I installed AWS Toolkit for Eclipse, on Eclipse Jee 2018-12 - When I installed it 2 years ago, it worked fine and the lambda project was deployed in the Lambda Service directly from Eclipse without any configuration from my side; congratulations for this clean deploy configuration ! - An year ago this deploy started not to complete successfully: it worked only until the transfer of the eclipse archive in S3, without installation in Lambda Service. I have to do the installation of the S3 archive from the Management Console -> Lambda console, manually. - The Error Cause: **An update is in progress for resource**: arn:aws:lambda:us-east-2:255864408802:function:RekonAddUser (Service: AWSLambda; Status Code: 409; Error Code: **ResourceConflictException**; Request ID: 408040a5-f1fe-4ba0-b251-df0c2fc8fe9c) This cause was thrown wile I did not have any other interaction with that resource ! - The message was: Failed to upload project to Lambda - The error was: com.amazonaws.eclipse.core.exceptions.AwsActionException: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:us-east-2:255864408802:function:RekonAddUser (Service: AWSLambda; Status Code: 409; Error Code: ResourceConflictException; Request ID: 408040a5-f1fe-4ba0-b251-df0c2fc8fe9c) at com.amazonaws.eclipse.lambda.upload.wizard.UploadFunctionWizard.doFinish(UploadFunctionWizard.java:115) at com.amazonaws.eclipse.core.plugin.AbstractAwsJobWizard$1.run(AbstractAwsJobWizard.java:35) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: com.amazonaws.services.lambda.model.ResourceConflictException: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:us-east-2:255864408802:function:RekonAddUser (Service: AWSLambda; Status Code: 409; Error Code: ResourceConflictException; Request ID: 408040a5-f1fe-4ba0-b251-df0c2fc8fe9c) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1639) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1056) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667) at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513) at com.amazonaws.services.lambda.AWSLambdaClient.doInvoke(AWSLambdaClient.java:2654) at com.amazonaws.services.lambda.AWSLambdaClient.invoke(AWSLambdaClient.java:2630) at com.amazonaws.services.lambda.AWSLambdaClient.executeUpdateFunctionCode(AWSLambdaClient.java:2514) at com.amazonaws.services.lambda.AWSLambdaClient.updateFunctionCode(AWSLambdaClient.java:2490) at com.amazonaws.eclipse.lambda.upload.wizard.util.UploadFunctionUtil.performFunctionUpload(UploadFunctionUtil.java:134) at com.amazonaws.eclipse.lambda.upload.wizard.UploadFunctionWizard.doFinish(UploadFunctionWizard.java:111) ... 2 more - The Session Data: eclipse.buildId=4.10.0.I20181206-0815 java.version=1.8.0_60 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product Thank you,
0
answers
0
votes
11
views
asked 16 hours ago

Concurrent executions of Lambda functions

I would like to understand how many calls of a Lambda function, through AWS-SDK, I can perform simultaneously. Now I am a free tier and it seems that I can't performe more than 10 concurrently executions. In my project, each client is going to make running a function and so the number of concurrently executions that my aws account can performe would be equal to the number of clients that my web app can serve simultaneously. I will be fine with 1000 at the beginning. Is it possible? How many concurrently executions my aws account (if not anymore free tier) could manage of a single function and overall through all functions by default? I will use Europe (Milano) region. With my account, right now, I can performe 10 concurrent executions of my function. I attached my concurrency data in the image:![Enter image description here](/media/postImages/original/IMS9LLlqoWQcqO9cDBFWBcOw) And my code:; import AWS from 'aws-sdk'; AWS.config.update({ accessKeyId: 'idKey', secretAccessKey: 'SecretKey', region: 'eu-west-3', }); const lambda = new AWS.Lambda(); var Utente = {feature: "feature"}; const params = { FunctionName: 'Lambda', Payload: JSON.stringify(Utente) }; ˙ lambda.updateFunctionConfiguration({ FunctionName: 'Lambda', Environment: { Variables: {} } }).promise(); function Invokation(params){ lambda.invoke(params, (error, data) => { if (error) { console.log(error) } else { console.log("OK") } }) }; for (let index = 0; index < 20; index++) { console.log(index); Invokation(params); }
1
answers
0
votes
22
views
asked 3 days ago

Glue running in Docker not able to find com.mysql.cj.jdbc.Driver

Following along with this [blog post](https://aws.amazon.com/blogs/big-data/develop-and-test-aws-glue-version-3-0-jobs-locally-using-a-docker-container/) I'm attempting to debug/breakpoint my glue tasks running in VS Code using `amazon/aws-glue-libs:glue_libs_3.0.0_image_01`. I can get up to the point where the job executes and I can step through the code right up until the point I try and connect to RDS to fetch data. As soon as I do I get back ``` An error occurred while calling o47.getDynamicFrame. : java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver at java.net.URLClassLoader.findClass(URLClassLoader.java:387) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.amazonaws.services.glue.util.JDBCUtils.loadDriver(JDBCUtils.scala:214) at com.amazonaws.services.glue.util.JDBCUtils.loadDriver$(JDBCUtils.scala:212) at com.amazonaws.services.glue.util.MySQLUtils$.loadDriver(JDBCUtils.scala:490) at com.amazonaws.services.glue.util.JDBCWrapper.getRawConnection(JDBCUtils.scala:746) at com.amazonaws.services.glue.JDBCDataSource.getPrimaryKeys(DataSource.scala:1006) at com.amazonaws.services.glue.JDBCDataSource.$anonfun$getJdbcJobBookmark$1(DataSource.scala:878) at scala.collection.MapLike.getOrElse(MapLike.scala:131) at scala.collection.MapLike.getOrElse$(MapLike.scala:129) at scala.collection.AbstractMap.getOrElse(Map.scala:63) at com.amazonaws.services.glue.JDBCDataSource.getJdbcJobBookmark(DataSource.scala:878) at com.amazonaws.services.glue.JDBCDataSource.getDynamicFrame(DataSource.scala:953) at com.amazonaws.services.glue.DataSource.getDynamicFrame(DataSource.scala:99) at com.amazonaws.services.glue.DataSource.getDynamicFrame$(DataSource.scala:99) at com.amazonaws.services.glue.SparkSQLDataSource.getDynamicFrame(DataSource.scala:714) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244) at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357) at py4j.Gateway.invoke(Gateway.java:282) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.lang.Thread.run(Thread.java:750) ``` I'm not sure how to solve this problem. I see in the blog post its mentioned that I can pass in extra libraries, however when I look in `/home/glue_user/aws-glue-libs/jars` I can see a jar named `mssql-jdbc-7.0.0.jre8.jar` so I'm not so sure thats the problem. I should mention this job runs without a problem when deployed to AWS. I'm currently starting up the `amazon/aws-glue-libs:glue_libs_3.0.0_image_01` using a very basic docker-compose file ``` version: "3.8" services: glue: container_name: "glue-local-development" image: amazon/aws-glue-libs:glue_libs_3.0.0_image_01 ports: - "4040:4040" - "18080:18080" environment: - DISABLE_SSL=true - AWS_PROFILE=my_profile volumes: - ~/.aws:/home/glue_user/.aws - ${PWD}:/home/glue_user/workspace/ stdin_open: true ``` Then connecting as per the blog post. Is there something else I have to do here? I don't think I should have to manually load in the mysql jars? I've been stuck at this point for awhile so would really appreciate any help or suggestions people have Edit: Interestingly when I attempt to run `amazon/aws-glue-libs:glue_libs_2.0.0_image_01` it fails with a very similar but different error ``` : An error occurred while calling o49.getDynamicFrame. : java.io.FileNotFoundException: (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at com.amazonaws.glue.jdbc.commons.CustomCertificateManager.importCustomJDBCCert(CustomCertificateManager.java:127) at com.amazonaws.services.glue.util.JDBCWrapper$.connectionProperties(JDBCUtils.scala:947) at com.amazonaws.services.glue.util.JDBCWrapper.connectionProperties$lzycompute(JDBCUtils.scala:734) at com.amazonaws.services.glue.util.JDBCWrapper.connectionProperties(JDBCUtils.scala:734) at com.amazonaws.services.glue.util.JDBCWrapper.getRawConnection(JDBCUtils.scala:747) at com.amazonaws.services.glue.JDBCDataSource.getPrimaryKeys(DataSource.scala:996) at com.amazonaws.services.glue.JDBCDataSource$$anonfun$33.apply(DataSource.scala:868) at com.amazonaws.services.glue.JDBCDataSource$$anonfun$33.apply(DataSource.scala:868) at scala.collection.MapLike$class.getOrElse(MapLike.scala:128) at scala.collection.AbstractMap.getOrElse(Map.scala:59) at com.amazonaws.services.glue.JDBCDataSource.getJdbcJobBookmark(DataSource.scala:868) at com.amazonaws.services.glue.JDBCDataSource.getDynamicFrame(DataSource.scala:943) at com.amazonaws.services.glue.DataSource$class.getDynamicFrame(DataSource.scala:97) at com.amazonaws.services.glue.SparkSQLDataSource.getDynamicFrame(DataSource.scala:707) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244) at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357) at py4j.Gateway.invoke(Gateway.java:282) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.lang.Thread.run(Thread.java:750) ```
1
answers
0
votes
38
views
asked 7 days ago

C++ Lambda - segmentation fault

Hi, I am trying to create a lambda function with access to an S3 bucket and allow operations to the bucket such as create and delete files (the usual I assume). I installed (on my windows pc) a WSL instance of ubuntu 20.04 and I installed AWS CLI according to: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.htm I then followed the guide to configure and set access keys: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html Now, I followed the guide on creating a hello world lambda function in c++: https://aws.amazon.com/blogs/compute/introducing-the-c-lambda-runtime/ The first example, all is fine and the lambda function successfully runs from the aws console without any errors or warnings. Now, when I continue the same guide to the "beyond hello", things start going wrong. I successfully setup all what was needed and installed the SDK's as required. Now, when I try to make the project, the compiler stops with this message: ``` cpp-encoder-example/main.cpp:78:56: error: no matching function for call to ‘Aws::S3::S3Client::S3Client(std::shared_ptr<Aws::Auth::EnvironmentAWSCredentialsProvider>&, Aws::Client::ClientConfiguration&)’ 78 | S3::S3Client client(credentialsProvider, config); ``` followed by a few lines with this note where n = 5, 4 and 1. (line number is of the first warning thrown) ``` include/aws/s3/S3Client.h:96:9: note: candidate expects n arguments, 2 provided ``` Now, when I remove 'credentialsProvider' from S3::S3Client client(credentialsProvider, config); in main.cpp, all does compile. (should that work?) However, I then continue to create the lambda function and when created and I press test in the aws console, it stops with: ``` s2n_init() failed: 402653268 (Failed to load or unload an openssl provider) Fatal error condition occurred in /home/username/aws-sdk-cpp/crt/aws-crt-cpp/crt/aws-c-io/source/s2n/s2n_tls_channel_handler.c:197: 0 && "s2n_init() failed" Exiting Application No call stack information available START RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Version: $LATEST 2022-11-21T09:02:07.642Z xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Task timed out after 1.02 seconds END RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx REPORT RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Duration: 1015.50 ms Billed Duration: 1000 ms Memory Size: 128 MB Max Memory Used: 16 MB ``` Now, for some reason I think something is failing during compile time with the certificates. What certificates may I not have set correctly, what installation step might I have missed? Have I failed at something else and can someone give me a pointer (pun not intended) to what to do / try? Ps. I'm not sure what tags to add since sdk or c++ are not included in them.
1
answers
0
votes
20
views
asked 9 days ago

How to get ip addresses of apigateway vpce using cdk?

**Background context / End goal:** I am trying to use cdk to create a target group that consists of the ip addresses that are associated with a vpc endpoint (for apigateway) as per this [AWS blog.][1] Ideally, I would like to be able to just lookup the associated ips using just the fact that the vpce is for the service of apigateway OR potentially using the vpce id. **Problem** I cannot find a way to get the network interface ids & ip addresses for the vpc endpoint. **Attempts** 1. I tried to use the cdk [InterfaceVpcEndpoint construct][2] static method using the fromInterfaceVpcEndpointAttributes (filtering by service). It did return the desired vpce, but unfortunately it returns [in the format of IInterfaceVpcEndpoint][3] which does not have the vpceNetworkInterfaceIds attribute that the InterfaceVpcEndpoint construct has 2. I was able to use [AwsCustomResource][4] (after consulting a stack overflow post that referenced [this example][5]) to look up the ip addresses for a given array of vpce network interface ids: ``` const vpceNetworkInterfaceIds = =['eniId1', 'eniId2']; const getEniIps = new AwsCustomResource(scope, `GetEndpointIps`, { onUpdate: { service: "EC2", action: "describeNetworkInterfaces", parameters: { NetworkInterfaceIds: vpceNetworkInterfaceIds }, physicalResourceId: PhysicalResourceId.of(Date.now().toString()) }, policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE }), }); const privateIpAddresses: string[] = []; for(let i = 0; i< vpceNetworkInterfaceIds.length; i++){ const privateIpAddress: string = getNetworkInterfaceIpAddresses.getResponseField(`NetworkInterfaces.${i}.PrivateIpAddress`).toString(); privateIpAddresses.push(privateIpAddress); } return privateIpAddresses; } ``` 3. I tried to make a similar sdk call ([describeVpcEndpoints][6]), but then I encountered issues retrieving the array of NetworkInterfaceIds. ``` const getNetworkInterfaceIpAddresses = new AwsCustomResource(scope, `GetVpceNetworkInterfaceIds`, { onUpdate: { service: "EC2", action: "describeVpcEndpoints", parameters: { Filters: [ { Name: "service-name", Values: ["com.amazonaws.us-east-1.execute-api"] } ] }, physicalResourceId: PhysicalResourceId.of(Date.now().toString()) }, policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE }), }); return getNetworkInterfaceIpAddresses.getResponseFieldReference(`VpcEndpoints.0.NetworkInterfaceIds`).toJSON(); ``` I tried variations of using the [Reference][7] methods of toJson, toString, Token.asXXX but was not able to figure out how to get the array of values from this custom resource. One of the errors that I got was "Vendor response doesn't contain VpcEndpoints.0.NetworkInterfaceIds key in object ....." but when I made the describeVpcEndpoints call via cli, I can definitely see that there is a VpcEndpoints.0.NetworkInterfaceIds value that should be populated. **Questions** 1. How can you get an array from the sdk call of a aws custom resource? 2. How can you debug cdk aws custom resources that make sdk calls? Logging locally only yields the tokens which is not helpful. 3. Is there a more straight forward way to get the vpceNetworkInterfaceIds of a given vpce? 4. Is there a more straight forward way to get the ip addresses for a given vpce? [1]: https://aws.amazon.com/blogs/networking-and-content-delivery/accessing-an-aws-api-gateway-via-static-ip-addresses-provided-by-aws-global-accelerator/ [2]: https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ec2.InterfaceVpcEndpoint.html#vpcendpointnetworkinterfaceids [3]: https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ec2.IInterfaceVpcEndpoint.html [4]: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources.AwsCustomResource.html#getwbrresponsewbrfielddatapath [5]: https://github.com/taimos/cdk-constructs/blob/master/lib/serverless/internal-rest-api.ts#L117 [6]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#describeVpcEndpoints-property [7]: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Reference.html#towbrstringwbrlist
1
answers
0
votes
62
views
asked 11 days ago