Posts

Showing posts with the label amazon-web-services

How to upload assets to AWS presignedurl from ClientSide javascrript

Image
Clash Royale CLAN TAG #URR8PPP How to upload assets to AWS presignedurl from ClientSide javascrript I am approching presignedUrl method to upload a large file . I call an API from my angular code to server side which gives me presignedUrl , then I need to upload an URL . I have some question on this 1) Is there need to AWS SDK on my Angular side ? I assume I dont need it , I just sent PUT request to unsigned URL and file uploadfileAWSS3old(e,f){ const formData = new FormData(); formData.append("data",JSON.stringify({name:"testname"})); formData.append("file", f.files[0]); let contentType = f.files["0"].type; const headers = new HttpHeaders( { 'Content-Type': contentType }); const req = new HttpRequest('PUT',this.URL,formData, { headers: headers, reportProgress: true, //This is required for track upload process }); console.log(req) this.http.r...

How do I run my CDK app?

Image
Clash Royale CLAN TAG #URR8PPP How do I run my CDK app? I created and built a new CDK project: mkdir myproj cd myproj cdk init --language typescript npm run build If I try to run the resulting javascript, I see the following: PS C:reposmyproj> node .binmyproj.js CloudExecutable/1.0 Usage: C:reposmyprojbinmyproj.js REQUEST REQUEST is a JSON-encoded request object. What is the right way to run my app? 2 Answers 2 You don't need to run your CDK programs directly, but rather use the CDK Toolkit instead. To synthesize an AWS CloudFormation from your app: cdk synth --app "node .binmyproj.js" To avoid re-typing the --app switch every time, you can setup a cdk.json file with: --app cdk.json { "app": "node .appmyproj.js" } You can also use the toolkit to deploy your app into an AWS environment: cdk deploy Or list all the stacks in your app: cdk ls The CDK application ...

access amazon s3 bucket without region end point

Image
Clash Royale CLAN TAG #URR8PPP access amazon s3 bucket without region end point Currently, I am accessing Amazon S3 using the Access key, Secret Access Key and region endpoint in Amazon S3 SDK which working fine. Like this client = new AmazonS3Client("some-access-key", "some-secret-key",Amazon.RegionEndpoint.USEast1) Is it possible to remove region endpoint because Bucket name will be one globally so why we need region endpoint? There must be some way through which we can able to get region endpoint of the bucket in Amazon S3 SDK?? or can work without region endpoint if "Yes" then How ?? if "No" then Why?? 1 Answer 1 A bucket will always have a region, when leaving it blank it will create the bucket in the US East region for you. There can be several reasons for choosing a region, from the API reference: By default, the bucket is created in the US East (N. Vi...

Multiple cron jobs in different files in AWS ec2

Image
Clash Royale CLAN TAG #URR8PPP Multiple cron jobs in different files in AWS ec2 I am using AWS ec2 for my projects.I Have more than 10 domain in one ec2 instance also which has more than 5 cron for each domain.Can i create different files for crontab. If create all the cron jobs code in a single file it is little bit confusing By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Can not connect with AWS : Connection time out error

Image
Clash Royale CLAN TAG #URR8PPP Can not connect with AWS : Connection time out error I am using ssh command to connect with AWS instance : ssh -i ./abcd.pem ubuntu@ec2-**-***-**-**.us-east-2.compute.amazonaws.com ssh -i ./abcd.pem ubuntu@ec2-**-***-**-**.us-east-2.compute.amazonaws.com These are my inbound rules : Earlier It was working well suddenly it started giving this error I have also tried with different networks still the same problem. 1 Answer 1 Assuming that AWS hasn't stopped you from connecting because you're out of money, the simplest explanation is that your host is simply unstable and needs to be rebooted. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

AWS lambda VPC cannot reach internet with IG attached

Image
Clash Royale CLAN TAG #URR8PPP AWS lambda VPC cannot reach internet with IG attached I have an AWS lambda function that makes a request to the internet. When it makes the request with NO VPC, it's ok, but when I add it to the VPC, it stops working. I've attached an Internet Gateway to the VPC and created a NAT Gateway with RT to use outbound 0.0.0.0/0, but it stills not working. With 15seconds timeout, it's always throwing TO. Could you please help me? I've already follow these sites: - https://gist.github.com/reggi/dc5f2620b7b4f515e68e46255ac042a7 - http://derpturkey.com/lambda-vpc-and-internet-access-configuration/ Everything seems to be well configured. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

What TCP port number does the aws cli s3 use?

Image
Clash Royale CLAN TAG #URR8PPP What TCP port number does the aws cli s3 use? When you upload or download files via aws cli, what TCP port number does it use over the internet? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

boto3 / s3 - how can you connect with uid/pwd in like you could previously ?

Image
Clash Royale CLAN TAG #URR8PPP boto3 / s3 - how can you connect with uid/pwd in like you could previously ? I have some code which I want to port to boto3. Previously it was possible to do this : conn = boto.connect_s3(sys.argv[1], sys.argv2) In the current documentation it's assumed that you have a config file setup with the uid/pwd in it or that you use environment variables and so there is no explicit passing of the uid/pwd when initiating a connection. Is it now impossible to to just pass in the values as per my example or is there some way I've missed in the documentation ? Thanks See: Credentials — Boto 3 Docs documentation – John Rotenstein 20 mins ago 1 Answer 1 When writing AWS Python code, the SDK can automatically find your AWS credent...

How to create a minimal and complete IAM roles/permissions given requirements?

Image
Clash Royale CLAN TAG #URR8PPP How to create a minimal and complete IAM roles/permissions given requirements? IAM gives developers controls to limit which users can access specific services, the kinds of action they can perform, and which resources are available (VMs, database instances, etc). Given a list of resources, API calls, and services used, how does one go about creating a minimal (but sufficiently free) IAM role or user for this project? Inspired by Exelian's reponse to Jiew Meng in Is there anyway to determine what IAM permissions I actually need for a CloudFormation template?: Jiew Meng: "I guess, it should be possible for there to be some parser that given a CloudFormation template can determine the minimum set of permissions it" Exelian: "I discussed this with multiple AWS engineers at a conference and their answer was: "not really". Best way is to assign nothing and see what errors it throws." ...

AWS Neo4j Connection Issue

Image
Clash Royale CLAN TAG #URR8PPP AWS Neo4j Connection Issue I am using PuTTy to try to connect to AWS. I've followed the instructions at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html?icmpid=docs_ec2_console You are asked to get you instanceID, but then its use is not mentioned. Where does it go in the PuTTy setup? My setup at present is: port: 22 Authentication: link to my certificate, modified for PuTTY Connection>Data>Autologin>Username: I've tried numerous items here but none works. The error I get is connection timeout. I'm using Windows 10 and have checked to ports for Putty in the Windows and McAfee firewalls ... Putty is enabled. I've check the ports at AWS and they are enabled. I'm stumped and not sure where to go next. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that ...

Erro trying to save Text messaging preferences on aws

Image
Clash Royale CLAN TAG #URR8PPP Erro trying to save Text messaging preferences on aws I'm trying to change Text messaging preferences. I'm getting this error Invalid parameter: (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: 2681ed63-5c47-5bb6-a4c3-beb27367210a) I have 4 clientes that use AWS, and I get this error in every clients account. 1 Answer 1 After 7 days talking with AWS support, I get the solution. Believe or not, it's simple. The input "Default sender ID" must have only 11 digits. Why not just say it on error message? ;) By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Amazon S3 - HTTPS/SSL - Is it possible? [closed]

Image
Clash Royale CLAN TAG #URR8PPP Amazon S3 - HTTPS/SSL - Is it possible? [closed] I saw a few other questions regarding this without any real answers or information (or so it appeared). I have an image here: http://furniture.retailcatalog.us/products/2061/6262u9665.jpg Which is redirecting to: http://furniture.retailcatalog.us.s3.amazonaws.com/products/2061/6262u9665.jpg I need it to be (https): https://furniture.retailcatalog.us/products/2061/6262u9665.jpg So I installed a wildcard ssl on retailcatalog.us (we have other subdomains), but it wasn't working. I went to check https://furniture.retailcatalog.us.s3.amazonaws.com/products/2061/6262u9665.jpg And it wasn't working, which means on the Amazon S3 website itself the https wasn't working. How do I make this work? Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be r...

True LoadBalancing in Kubernetes?

Image
Clash Royale CLAN TAG #URR8PPP True LoadBalancing in Kubernetes? What is a Load Balancer? Load balancing improves the distribution of workloads across multiple computing resources, such as computers, a computer cluster, network links, central processing units, or disk drives NodePort is not load balancer. (I know that kube-proxy load balance the traffic among the pod once the traffic is inside the cluster) I mean, the end user hits http://NODEIP:30111 (For example) URL to access the application. Even though the traffic is load balanced among the POD, users still hits a single node i.e. the "Node" which is K8s's minion but a real Load Balancer, right? kube-proxy http://NODEIP:30111 Here also same, imagine the ingress-controller is deployed and ingress-service too. The sub-domain that we specify in ingress-service should points to "a" node in K8s cluster, then ingress-controller load balance the traffic among the pods. Here also end users hitting single nod...

AWS Lambda how do I properly allow CORs?

Image
Clash Royale CLAN TAG #URR8PPP AWS Lambda how do I properly allow CORs? I know this question gets asked a lot and I have looked through other questions/answers but I still can't get it to work. I have read and followed: https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html This is my lambda function: let http = require('https') exports.handler = (event, context, callback) => { const STORE_HASH = '1234' const PATH = `/stores/${STORE_HASH}/v3/catalog/products?limit=100` const AUTH_TOKEN = '1234' const AUTH_CLIENT = '1324' let options = { "method": "GET", "hostname": "api.bigcommerce.com", "port": null, "path": PATH, "headers": { "x-auth-client": AUTH_CLIENT, "x-auth-token": AUTH_TOKEN, "content-type": "application/json", ...

Cname for AWS API Gateway custom domain

Image
Clash Royale CLAN TAG #URR8PPP Cname for AWS API Gateway custom domain the concept is simple. Create a Cname switch that points to blue / green deployment channels via AWS API Gateway. The API has two stages for blue and green mapped back into an environment variable which in turns maps back into the Lambda alias associated with it's own dedicated version. Therefore there are now two separate channels for conducting deployments into. All of this works fine. The issue arises when a Cname is created in Route53 to point to either of the API Gateways blue or green custom domains. The SSL cert is held in AWS Certificate Manager. When we call the blue endpoint via the Cname we get an SSL error curl -Il -H "Host:blue-api.example.com" -H "x-api-key:xxxxxxxxx" -X GET https://cname-api.example.com/questions/health curl: (35) SSL peer handshake failed, the server most likely requires a client certificate to connect Whereas when we call the custom domain directly it works c...

Iterating a list of lists within Python for aws lambda

Image
Clash Royale CLAN TAG #URR8PPP Iterating a list of lists within Python for aws lambda I have a question related to python. The use case is to write a python function (in aws lambda) which will look for a set of files in multiple buckets and return some action like creating a dummy file in s3 bucket or triggering another lambda. For eg: list1=[file1,file2,file3] list2=[file4,file5,file6] list3=[f7,f8,f9] def lambda_handler(event,context): if len(list1)==9: print("something") //create dummy file in s3 OR, trigger another lambda elif len(list2)==9: print("Something") else: print("all files are not available") and like wise. I am a bit confused about how to do iteration within the 3lists and trigger one lambda for one set of file say list1 or list2 or list3. Or alternatively I can create a dummy file in s3. Can anyone please help me with the way to do it? Could you please clarify your question? Are you asking how to w...