Can we restrict downloading of source code from AWS Cloud9 IDE? - amazon-web-services

Is there any option in AWS to restrict developers to download source code from Cloud9 IDE ?

I don't think that could be possible, even if they (AWS) wanted to. If someone can see the code, they can copy the code - if only by copy and paste - so any attempt to prevent someone from downloading what they can already see with their own eyes, is going to fall short.

Related

How to see code of running EC2 instance in AWS?

So I've recently joined in a project. They asked me to develop a particular module so I did. Now I need to integrate it with the system. They gave me AWS login credentials for the integration purpose. I'm new to AWS and I don't wanna sound dumb to them by asking where's the code. I saw that there's an EC2 instance running but I see no option to see code there. So can you please let me know where can I see the code of running EC2 instance?
Never feel dumb about asking questions on your team. It's much better to ask questions and seek clarification, rather than assume and waste your time and theirs.
So if your team is tasking you with integrating a module you've built with something running on EC2, they probably have an API of some sorta to integrate. They likely aren't expecting you to go to EC2 and view code or decompile DLLs to view source code.
However, to potentially answer your question if your EC2 instance is running some sort of application that has DLLs, you can download those and decompile them using various tools to view the actual source code. YOu would of course need the keypair to access the EC2 instances so you'd have to get that first.
I would just ask someone on your team how to integrate with the system running on EC2. They likely have the source code stored somewhere in a repository.

Enable inline editing for the Go code in the AWS Lambda

As inline code editing is not enabled for the Go code on AWS Lambda, I am trying to create a Google Chrome Extention to be able to edit the Go code by referring to the text or zip code on the S3 bucket. It would be nice if I could also deploy the updated Go code on the Lambda.
I think I will have to perform the following steps from the extension-
Get the Go code from the S3 bucket or Github
Update it
Create a zip file from the updated code
Upload the zip file to the S3 bucket or Github
Deploy the updated zip file on the Lambda
I have no idea if it is a good approach or if there is any other approach possible for this. I would appreciate it if anyone can suggest to me a better approach or tell me if what I am thinking is feasible or not.
I like the idea, but unfortunately I am not sure if that is a good idea.
Let me explain:
All the languages that AWS Lambda supports which allow inline editing are more or less interpreted languages: Javascript, Python etc.
The AWS runtime for those languages reads plain text files and compiles/runs them.
Since you deploy plain text files and the runtime takes care of running them, the AWS Lambda console allows you to edit those files.
Go on the other hand, as well as supported languages like Swift or Java, need to be deployed as a "binary" (I use air quotes because Java JAR is strictly seen not a binary but byte code which is then interpreted by the JVM ..) to AWS.
The AWS Lambda runtime for those languages expects a binary and not plain text. That is why you can not edit the code of Lambdas using those runtimes in the AWS console.
So even if you would open that ZIP, you would not find editable code.
Of course you could put the binary and the plain text code in that ZIP and then when you open that ZIP through your Chrome extension, you could show the plain text code to the user.
But then there is the matter of compiling the code into a binary that the AWS Lambda Go runtime can actually run.
So you Chrome extension would need to bundle a Go compiler. Not sure if that is possible. But I am sure it would not be trivial.

Best practice for using github and AWS lambda?

I'm writing AWS lambda's in the browser and want to improve my version control process from the present setup, which is to copy paste the lambda code into a text file and manually commit to a repository.
Is there a better (and preferably straight-forward) way of using AWS lambda with version control (in my case git/github)?
There is an example in this git repository provided by AWS.
It is a bit too big to retype it here.
You can try this to get your code sync with GitHub
https://npm.io/package/aws-lambda-sync

How to download and edit lambda with AWS explorer

I'm trying to use AWS explorer in PyCharm to download and edit an existing lambda function on my AWS account, but I'm unable to find out how to do that. I've read through all the documentation available on the wiki as well as followed a bunch of tutorials on deploying new lambda functions, but I can't find out how to edit and download existing functions. I can download the AWS lambda using the console, but I'm not sure how to get this to be editable in my PyCharm project, but this also seems like a workaround anyway. Is there a way to do this within the AWS Explorer tool?
No, currently (Oct 2019) you can't download a Lambda Function's source and edit it locally. If you know the name of the S3 object where the code is stored, you could pull that file down adn make changes, re-zip it, re-upload it back to S3, force the Lambda to cold-start (change the memory slider) and it will pick up the new code. but this is extremely brittle.
Have you tried cloud9, I find it the best way to work on lambdas, especially if you are working as a team. but the problem with cloud9 is also it seems it's not actively being developed and you have lots of manual work to update SAM and dev tools in there. Anyhow I still recommend cloud9.

Upload to AWS EC2 via Putty command line

I have tried code entered into the putty command line such as
rsync -avz myHugeFile.dat amazonusername#my.amazon.host.ip:
Trouble Uploading Large Files to RStudio using Louis Aslett's AMI on EC2
(code taken from the linked question above)
Though I could not get it to work and I think this was due to not knowing how to properly frame it in light of the location of the files.
I am putting this as a separate question rather than a comment as I don't have enough 'reputation' to comment. in the context of a windows user asking this
1) Was I correct to use this in Putty?
2) Did I need to put anything before it?
3) the only things editable are the address of the EC2 so I have that correct and the location of the file. If the file is on the desktop, how would I write this?
Even if you can only answer one of these basic questions it would be really helpful as I piece together code on how to do this.
If this question is too basic for this site and your are going to remove, could you please give me an answer before doing so ;)
to sum up what we said in comments: don't use putty to upload files, it is more intended to ssh to your instances. Use a software like winscp or filezilla instead, which are free and easy to use, you will find it a lot easier