The Wayback Machine - https://web.archive.org/web/20230329200641/https://repost.aws/

Follow popular topics

see all

Top contributors

see all
RankNameTotal points
1
1,691
2
1,577
3
1,327
4
1,224
5
1,170

Recent questions

see all
1/18
  • Is there an API call you can make that gives you the state capacity (used/available) of the bucket (capacity and refill rate). CloudWatch monitors failures (RequestLimitExceeded) but only once you exceeded the limit, so you can be at the 99% mark and see zero failures and then pass it without noticing.
    0
    answers
    0
    votes
    1
    views
    Kobster
    asked 27 minutes ago
  • ```">Login request was received, the username and password were correctly extracted from the request body, and a user with ID 1 was found in the database. The form still 504 fails eventually. my index.js, db.js, users.js, and login.html all seem fine. I'm on Lightsail so unfortunately I've had to use SQL Workbench this whole time. Not sure if there's an issue with the Lightsail to DB communication? It's been a pain to try to figure out Lightsail with the 'module' stuff like databases. users.js : ``` const connection = require('./db'); const bcrypt = require('bcrypt'); const saltRounds = 10; class User { constructor(id, username, password, email, createdAt, updatedAt) { this.id = id; this.username = username; this.password = password; this.email = email; this.createdAt = createdAt; this.updatedAt = updatedAt; } static create(username, password, email) { const now = new Date().toISOString(); const sql = `INSERT INTO loginserver (username, password, email, created_at, updated_at) VALUES (?, ?, ?, ?, ?)`; bcrypt.hash(password, saltRounds, (err, hash) => { if (err) { console.error('Error hashing password:', err); return; } const values = [username, hash, email, now, now]; connection.query(sql, values, (err, result) => { if (err) { console.error('Error creating user:', err); return; } console.log('User created with ID', result.insertId); const user = new User(result.insertId, username, hash, email, now, now); return user; }); }); } static getByUsername(username) { const sql = `SELECT * FROM loginserver WHERE username = ?`; connection.query(sql, [username], (err, results) => { if (err) { console.error('Error getting user by username:', err); return; } if (results.length === 0) { console.log('User not found'); return null; } const { id, username, password, email, created_at, updated_at } = results[0]; console.log('User found with ID', id); const user = new User(id, username, password, email, created_at, updated_at); return user; }); } checkPassword(password) { return new Promise((resolve, reject) => { bcrypt.compare(password, this.password, (err, isMatch) => { if (err) { console.error('Error checking password:', err); reject(err); } else { resolve(isMatch); } }); }); } update() { const now = new Date().toISOString(); const sql = `UPDATE loginserver SET username = ?, password = ?, email = ?, updated_at = ? WHERE id = ?`; const values = [this.username, this.password, this.email, now, this.id]; connection.query(sql, values, (err) => { if (err) { console.error('Error updating user:', err); return; } console.log('User updated with ID', this.id); this.updatedAt = now; return this; }); } delete() { const sql = `DELETE FROM loginserver WHERE id = ?`; connection.query(sql, [this.id], (err) => { if (err) { console.error('Error deleting user:', err); return; } console.log('User deleted with ID', this.id); return; }); } } module.exports = User; ``` index.js : ``` const express = require('express'); const https = require('https'); const socketIO = require('socket.io'); const path = require('path'); const fs = require('fs'); const mysql = require('mysql'); const User = require('./server/users'); const bodyParser = require('body-parser'); const app = express(); const server = https.createServer({ key: fs.readFileSync('/etc/letsencrypt/live/ispeedrun.tv/privkey.pem'), cert: fs.readFileSync('/etc/letsencrypt/live/ispeedrun.tv/fullchain.pem') }, app); const io = socketIO(server); // Add this before the routes app.use((req, res, next) => { console.log('Request received'); next(); }); app.use(express.static(path.join(__dirname, 'views', 'public'))); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json()); app.get('/', (req, res) => { res.sendFile(path.join(__dirname, 'views', 'index.html')); }); app.get('/live', (req, res) => { res.sendFile(path.join(__dirname, 'views', 'live.html')); }); const connection = mysql.createConnection({ host: 'ls-7f5846c26112d5a110aa9ce17f20838297ce7c51.cdnunzehdfq0.us-east-2.rds.amazonaws.com', port: '3306', user: 'dbmasteruser', password: '', database: '' }); connection.connect((err) => { if (err) { console.error('Failed to connect to MySQL:', err); return; } console.log('Connected to MySQL database'); }); io.on('connection', (socket) => { console.log('WebSocket connection established'); socket.on('message', (msg) => { console.log('message: ' + msg); io.emit('message', msg); }); socket.on('disconnect', () => { console.log('WebSocket connection closed'); }); }); // add this route to handle form submission app.post('/login', (req, res) => { console.log('Received login request'); console.log('Login request received:', req.body); // Log the received request const { username, password } = req.body; User.getByUsername(username, (err, user) => { if (err) { console.error('Error getting user:', err); res.status(500).send('Internal server error'); return; } if (!user) { res.status(401).send('Invalid username or password'); return; } user.checkPassword(password, (err, isMatch) => { if (err) { console.error('Error checking password:', err); res.status(500).send('Internal server error'); return; } if (!isMatch) { res.status(401).send('Invalid username or password'); return; } res.status(200).send(); // Send a 200 status code to indicate a successful login }); }); }); // Add this after the routes app.use((req, res, next) => { console.log('Response sent'); next(); }); const PORT = process.env.PORT || 6611; server.listen(PORT, () => { console.log(`Server running on port ${PORT}`); }); ``` login.html : ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>iSpeedrun.TV - Login</title> <link rel="stylesheet" href="styles.css"> <style> /* Keep the same styles as index.html */ .main-container { display: flex; flex-direction: row; } .video-container { width: 1280px; height: 720px; margin-right: 20px; } .video-container iframe { width: 100%; height: 100%; } .sidebar { width: 300px; height: 720px; display: flex; flex-direction: column; justify-content: space-between; } .sidebar-item { display: flex; align-items: center; padding: 10px; background-color: #222; color: #fff; font-size: 14px; } .sidebar-item img { width: 60px; height: 60px; margin-right: 10px; } header { display: flex; justify-content: space-between; align-items: center; background-color: #222; color: #fff; padding: 10px; } nav ul { display: flex; list-style: none; padding: 0; margin: 0; } nav li { margin-right: 20px; } nav a { color: #fff; text-decoration: none; font-weight: bold; font-size: 16px; text-transform: uppercase; } nav a:hover { color: #ff0000; } .login-container { background-color: #fff; padding: 40px; border-radius: 10px; width: 70%; margin: 20px auto; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); } .login-container label { font-size: 20px; margin-bottom: 20px; } .login-container input[type="text"], .login-container input[type="password"] { width: 100%; height: 40px; margin-bottom: 30px; padding: 10px; font-size: 16px; border-radius: 5px; border: none; box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3); } .login-container button[type="submit"] { display: block; width: 100%; height: 50px; background-color: #e74c3c; color: #fff; border: none; border-radius: 5px; font-size: 18px; cursor: pointer; transition: background-color 0.2s; } .login-container button[type="submit"]:hover { background-color: #c0392b; } #message { font-size: 18px; color: red; margin-bottom: 15px; } </style> </head> <body> <header> <h1>iSpeedrun.TV - Login</h1> <nav> <ul> <li><a href="index.html">Home</a></li> <li><a href="livestream.html">Live Streams</a></li> <li><a href="about.html">About Us</a></li> <li><a href="contact.html">Contact</a></li> <li><a href="login.html">Login</a></li> </ul> </nav> </header> <main class="main-container"> <div class="sidebar"> <div class="sidebar-item"> <img src="https://via.placeholder.com/60x60.png?text=User+1" alt="User 1"> <p>User 1</p> </div> <div class="sidebar-item"> <img src="https://via.placeholder.com/60x60.png?text=User+2" alt="User 2"> <p>User 2</p> </div> <div class="sidebar-item"> <img src="https://via.placeholder.com/60x60.png?text=User+3" alt="User 3"> <p>User 3</p> </div> <div class="sidebar-item"> <img src="https://via.placeholder.com/60x60.png?text=User+4" alt="User 4"> <p>User 4</p> </div> </div> <div class="video-container"> <form class="login-container" action="/login" method="post" id="login-form"> <label for="username">Username:</label> <input type="text" id="username" name="username"> <label for="password">Password:</label> <input type="password" id="password" name="password"> <div id="message"></div> <button type="submit">Login</button> </form> </div> </main> <script> const form = document.getElementById('login-form'); const message = document.getElementById('message'); form.addEventListener('submit', async function(event) { console.log('Form submitted'); event.preventDefault(); // Prevent the form from submitting normally const username = document.getElementById('username').value; const password = document.getElementById('password').value; try { console.log('Sending request to server'); const response = await fetch('/login', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ username, password }), }); console.log('Server responded with status:', response.status); if (response.status === 200) { localStorage.setItem('loggedIn', 'true'); window.location.href = 'index.html'; } else { const error = await response.json(); message.textContent = error.message; } } catch (error) { console.error('Error:', error); message.textContent = 'An error occurred. Please try again.'; } }); </script> </body> </html> ```
    0
    answers
    0
    votes
    5
    views
    asked 33 minutes ago
  • Amazon Polly We need the generated audios to be at 44.1 kHz. Can Amazon Polly be configured?
    0
    answers
    0
    votes
    2
    views
    MAPV
    asked an hour ago
  • Hello; Using the SubscribeToShard SDK call, one can receive events via HTTP when records are added to the shard. And other SDK calls allow one to determine what shards are in a Kinesis stream. Is there a way to receive events via HTTP when a shard is added to or removed from a stream, so that a program can know to add or remove a consumer for that shard? Or is it necessary to regularly call the ListShards API to determine what shards are in the stream? Thank you.
    0
    answers
    0
    votes
    3
    views
    asked 2 hours ago
  • I try to understand how the cold storage pricing works for AWS Backup. For instance let's say we have this scenario: `We have an EFS drive with 50 TB of data. The backup is scheduled for every day and data are transitioned to cold storage after 7 days. Every day 0.25 TB of data change` How will the storage type look like at the 9th day? Is it like the following? warm storage: 0.25 * 7 TB cold storage: 50 + 0.25 * 1 TB Thank you for the help!
    0
    answers
    0
    votes
    3
    views
    asked 2 hours ago
  • 0 Hi, I attended the AWESOME program and was issued a voucher for 50% discount towards the cost of my AWS CCp exam which is valid till 31 March 2023. I was able to successfully redeem the voucher at Pearson vue when I scheduled my exam on 31 March 2023. Now if I reschedule my exam to say 10 April 2023 (the voucher was valid till 31 march and I have redeemed that) will I have to pay the full fee OR will the exam be rescheduled without any extra charges.
    0
    answers
    0
    votes
    5
    views
    asked 2 hours ago
  • When trying to deploy a vision model generated using lookout for vision to a GreenGrass core device I get the following error from the aws.iot.lookoutvision.EdgeAgent component: COMPONENT_BOOTSTRAP_ERROR: FAILED_ROLLBACK_COMPLETE: Fail to execute bootstrap step for aws.iot.lookoutvision.EdgeAgent, exit code: 1 Error code hierarchy • DEPLOYMENT_FAILURE • COMPONENT_UPDATE_ERROR • COMPONENT_BOOTSTRAP_ERROR I am using an aarch64 device running Debian Linux and can successfully deploy other components to the device. The greengrass.log file on the device gives no additional information about the error. Please help if anyone knows what could be the cause of the error and a solution? Thanks!
    0
    answers
    0
    votes
    3
    views
    asked 2 hours ago
  • Please open my port 25 aws EC2 instance in my account my account Gmail is abrormuxtorov394@gmail.com My Elastic IP Information 13.48.51.229
    1
    answers
    0
    votes
    5
    views
    asked 3 hours ago
  • I am attempting to build a lambda (with boto3/python) using the list_findings call. My function is: ``` response = client.list_findings( findingCriteria={ 'criterion': { 'Job ID': { 'eq': ['5e8ff9bf55ba3508199d22e984129be6'] } } }, maxResults=50, nextToken='continued', sortCriteria={ 'attributeName': 'bucketArn', 'orderBy': 'DESC' } ) ``` The Job ID does exist within my Macie console. (And is intentionally 'hard coded' here at the moment however once working will be a variable.). When I attempt to test I receive the below error. Has anyone else ran into this issue? If so how is it corrected? Response ``` >{ "errorMessage": "An error occurred (ValidationException) when calling the ListFindings operation: 1 validation error detected: Value '{Job ID=FindingCondition(gt=null, gte=null, lt=null, lte=null, eq=[5e8ff9bf55ba3508199d22e984129be6], neq=null, eqExactMatch=null)}' at 'findingCriteria.criterion' failed to satisfy constraint: Map keys must satisfy constraint: [Member must have length less than or equal to 255, Member must have length greater than or equal to 1, Member must satisfy regular expression pattern: [\\w\\.]+]", "errorType": "ValidationException", "stackTrace": [ " File \"/var/task/grp_data_public_cloud_sdm_usaa_macie_scalable_solution_src/src/lmbd/list_findings.py\", line 35, in list_findings\n response = client.list_findings(\n", " File \"/opt/python/botocore/client.py\", line 530, in _api_call\n return self._make_api_call(operation_name, kwargs)\n", " File \"/opt/python/botocore/client.py\", line 960, in _make_api_call\n raise error_class(parsed_response, operation_name)\n" ] } ``` Tried looking at the API documentation at: https://docs.aws.amazon.com/macie/latest/APIReference/findings.html however according to it, none of the fields appear to be required (all show as false). I have also tried it with several variations on the job ID (variable, f string variable, tuple, etc...).
    1
    answers
    0
    votes
    24
    views
    Brian
    asked 3 hours ago
  • Hi, When building private api gateways fronted by a vpc endpoint, the consumer needs to provide a host header with the id of the api. A workaround to fix that is to provide an ALB with Route53 record, which then fronts the vpc endpoint. In this way the consumer does not need to provide an host header. Are there any other workaround so that a consumer does not need to provide host header in order to cal a vpc endpoint fronted private api gateway? Thanks
    0
    answers
    0
    votes
    4
    views
    profile picture
    EXPERT
    alatech
    asked 3 hours ago
  • I had bought a reserved instance for RDS db instance db.r5.4xlarge on January-05-2022 for 3 years duration. In the month of December-2022, I had to upgrade that instance to db.r5.8xlarge because we were facing some high database load. Since then I saw the increase in billing and I need your help to bring down these additional charges. I'm expecting to save the overall cost by $1500. I see that the reserved instance db.r5.4xlarge is being 100% utilized, at the same time $320.14 got charged in this month for USD 0.4303 hourly fee per Aurora MySQL, db.r5.4xl instance which is not there anymore in my account. so this $320.14 charges are extra for me. Then, these charges USD 0.021 per GB-month of backup storage exceeding free allocation for Aurora MySQL costed me $283.38 so far. Kindly advise how I can reduce the cost?
    0
    answers
    0
    votes
    5
    views
    asked 3 hours ago
  • MY VPS DOES NOT WORK, WHEN I OPEN IT IT TAKES 2 MINUTES TO JUST OPEN AND WHEN I DOES I GET A BLACK SCREEN AND AFTER A FEW SECONDS IT JUST TURNS OFF AND RETURNS ME TO MY DESKTOP. TO SUM IT ALL UP YOUR VPS DOES NOT WORK AT ALL, I DONT HAVE A PROBLEM INDISE THE VPS I HAVE A PROBLEM WITH THE VPS IT SELF ,IT DOES NOT RESPOND TO ANYTING ITS COMPLETELY USELSS AND I HAVE LEFT MY TRADING EA ON YOUR VPS TO RUN , AND IT DOES BUT NOW I NEED TO GO INSIDE THE VPS TO TURN IT OFF BECUASE IM CURRENTLY LOSING MONEY BECAUSE OF YOUR SHITTY PRODUCT. PLEASE TURN OF MY VPS AND CANCEL MY SUBSCRIPTION IMEDDIATELY!!!!!!!!!
    0
    answers
    0
    votes
    15
    views
    Karlo
    asked 3 hours ago
  • I've created in CodeArtifact a domain and a main repository called "MainRepo" with two upstreams stores: npm ("npm-store") and pipy ("pipy-store"). Then locally in my PC I've created a new folder and setup the connection using AWS CLI to "MainRepo" specifying npm as tool. After checking successfully that npm is now pointing to my repository with: ``` npm -d ping ``` I proceeded to install husky and commitlint: ``` npm install husky --save-dev npm install @commitlint/cli --save-dev ``` At this point would expected to see those packages (and their dependencies) showing up in my main repository (or at least the npm-store) but to my surprise neither of them where listed. Then I've made a number of tests, installing other packages but not a single one got added. Finally I've tried with: ``` npm install -g aws-cdk ``` and this was indeed added to my repo and showing up in the CodeArtifact console. Any clues on why the others packages got ignored by CodeArtifact?
    Accepted AnswerAWS CodeArtifact
    1
    answers
    0
    votes
    10
    views
    asked 3 hours ago
  • Hello everyone! I'm using Terraform to create a simple Application Load Balancer (ALB), but I keep encountering an error when running terraform apply. The error message seems to concatenate the ARN of the ELB Listener with the ARN of the AWS ACM Certificate, which I find strange. I've searched my entire project for any incorrect variable usage but couldn't find any issues. I'm hoping someone can help guide me through this problem. Here's the error message I'm getting: ``` Error: reading ELB (Elastic Load Balancing) Listener Certificate (arn:aws:elasticloadbalancing:us-east-1:{id}:listener/app/my-lb/###############/###############_arn:aws:acm:us-east-1:############:certificate/####################################): ListenerNotFound: One or more listeners not found ``` And here's a simplified version of my Terraform code: ``` terraform { required_providers { archive = { source = "hashicorp/archive" } aws = { source = "hashicorp/aws" version = "~> 4.0" } } required_version = ">= 1.4.2" } resource "aws_lb" "main" { name = "my-lb" load_balancer_type = "application" subnets = [some var] security_groups = [some var] } resource "aws_lb_target_group" "main" { name = "tg-main" vpc_id = [vpcid] port = 80 target_type = "ip" protocol = "HTTP" health_check { healthy_threshold = 3 interval = 100 timeout = 30 } #depends_on = [var.sh.main_alb] } resource "aws_lb_listener" "https" { load_balancer_arn = aws_lb.main.arn port = "443" protocol = "HTTPS" ssl_policy = "ELBSecurityPolicy-2016-08" certificate_arn = data.terraform_remote_state.global.outputs.certificate_arn default_action { type = "forward" target_group_arn = aws_lb_target_group.tg-main.arn } } ``` I'd really appreciate any guidance or suggestions to help me understand and resolve this issue. Thank you!
    0
    answers
    0
    votes
    4
    views
    0128
    asked 3 hours ago
  • I used AWS briefly and may use it again. However, for now I want to get rid of all my AWS services and not be charged until I need it again. I have deleted/removed every EC2 machine that i had. Every month I get charged about $0.40 and the description is just "EC2-other". I have no idea what else to remove. How can I stop these charges? I would prefer not to delete my account.
    1
    answers
    0
    votes
    8
    views
    asked 4 hours ago
  • I am the owner of the management account for my organization. However, I am unable to view or access the resources (EC2, S3, Lambda, etc) created by a user within my same organization. - Both accounts are in the same organization. - The resources are in us-east-1. I have made sure to select this region when browsing AWS services. - Both accounts have the FullAWSAccess SCP attached. - I tried enabling Tag Policies, tagging all resources with a shared tag, and creating a tag-based resource group. However, only my EC2 instance shows up when I try to create the resource group. - I tried using Resource Access Manager to create a new resource share. However, the wizard results in an error: "Organization o-XXXXXXXXXX could not be found." - I am up to date with my billing. How do I access resources created by other accounts in my organization?
    0
    answers
    0
    votes
    5
    views
    asked 4 hours ago
  • Hi Guys, I deployed my java app on EC2 and here I am doing call to Amazon Cognito in order to push user data. So I am getting below error, `Profile file contained no credentials for profile 'default': ProfileFile(profiles=[])". When you are trying the same on your local machine its working fine` My understanding was If I gave IAM role(CognitoSuperUser) which has permission for Cognito to Ec2, I don't have to put credentials in EC2 profile file. Am I wrong? will not EC2 be able to allow calling to Cognito without any configuration? Like I do call to S3 from Ec2 by allowing permission in the IAM role that assigned Ec2. This is the way I create client to call. is there any other way to make call instead of **ProfileCredentialsProvider** ``` this.cognitoClient = CognitoIdentityProviderClient.builder() .region(Region.US_EAST_2) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); ``` Thanks
    1
    answers
    0
    votes
    8
    views
    asked 4 hours ago
  • Hi, Is there a way to get the AWS Lambda Function URL string (or the bits to construct it) programmatically from the running instance of the Lambda itself? I tried the below options and neither of them had the necessary URL: 1. checked the input object in `handleRequest(Object input, Context context)` 2. checked the items in `System.getenv()` Thanks
    1
    answers
    0
    votes
    8
    views
    asked 4 hours ago

Recent Knowledge Center content

see all
1/18

Recent articles

see all
1/18