#aws (2023-04)
Discussion related to Amazon Web Services (AWS)
Discussion related to Amazon Web Services (AWS)
Archive: https://archive.sweetops.com/aws/
2023-04-03
Any nginx experts here ??
Just post your question. Maybe someone will be able to help
Here is my issue, We’ve been using nginx for our windows machine in prod, nowdays we’re facing nginx 504 gateway timeout issue when the application team click the export button which is included large files , so i have changed the timeout parameters values in nginx conf and it’s doesn’t work , can anyone give me any suggestions!
Could be anything. access/error logs might give you an idea. It also might be upstream issue.
if you go to the machine and attempt to download the files directly bypassing nginx does it work?
If the large file is part of the body, you’re probably hitting the client max body size parameter. It’s 1m by default.
Issue got resolved, after adding the proxy parameter into specific location
Thanks for your help
I guess people over here would appreciate more specific details on how you solved the issue
2023-04-04
2023-04-05
2023-04-06
re: Customer managed KMS Keys – i know they cost $1/key/month. If i rotate a key every year or ## of months, am i charged $1/month for every prior version? assuming yearly rotation:
• year 1 = 1 key = $12
• year 2 = 2 keys = $24
• year 3 = 3 keys = $36
• year 4 = 4 keys = $48
• etc. ?
Sigh, so the cost simply escalates from there and builds with each passing year. PCI compliance dictates that we rotate keys every year, so this is a reality i guess
You might consider Vault, although it has its downsides, too
I would definitely not use vault. But instead, just don’t rotate your keys automatically. When you need to rotate, do it manually. Then the cost problem will be resolved.
Are you saying use hashicorp vault to encrypt RDS databases and S3 volumes? Wasn’t sure how that even was possible.
@Warren Parad just noting – compliance/infosec team is the one mandating periodic rotation of encryption keys, unfortunately.
Turning on automatic rotation of your KMS keys doesn’t actually rotate the keys though
Hi everyone! I’m using parameter store for storing secret, but I found that adding each secret to the policy for each role is quite tiring, so I wonder how does everyone setup their ACL? Do you recommend using ABAC https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html?
Implement a strategy that uses principal and resource tags for permissions management.
what problem are you trying to solve?
Implement a strategy that uses principal and resource tags for permissions management.
I define a “namespace” using parameter store’s pathing (/service/env/context/key) and assign the role permission to pull all secrets from /service/env/context as needed
You mention “tiring”, no way to automate?
2023-04-07
2023-04-08
2023-04-11
2023-04-12
TIL about document history in the AWS Docs.
Examples below. Hope it helps!
https://docs.aws.amazon.com/AmazonS3/latest/userguide/WhatsNew.html https://docs.aws.amazon.com/eks/latest/userguide/doc-history.html
Find the revision dates, related releases, and important changes to the Amazon S3 User Guide.
Important updates to the Amazon EKS documentation, sorted by date, with brief descriptions of each update and when they occurred.
2023-04-13
Hi all, We are facing some authentication issue while login the linux server, we are using AD credentials to login, I’m able to login other server without any issues but i having only issue with one server, while checking the logs i could see the account is expired, since the server integrated with AD , I’m not able to modify the user password and all. If i change the password in the server , does it change entire AD password?? Or can anyone give some suggestions about activating the expired account !!
2023-04-14
Hello, Instances are not communicating with elasticbeanstalk, i have the same setup which is working good for other application, for new deployment its not.. getting the below error. expecting help on this.
The EC2 instances failed to communicate with AWS Elastic Beanstalk, either because of configuration problems with the VPC or a failed EC2 instance. Check your VPC configuration and try launching the environment again.
but i verified the network configurations are good, as the same is working for another deployment. there is no change in that..
There’s not enough information to diagnose the problem, you could try to paste your terraform code here to increase the chances. There coudl be many reasons, like hardcoded VPC that works in one environment but won’t work in others.
Hi folks, dealing with some permission issues with AWS Organizations. I wonder if someone could share some insights.
My current organizational structure:
root (r-123) / sandbox_ou (ou_123abc) / developer_ou (ou_321abc) / dev_aws_account
I’m getting permission errors when I try to create OUs or accounts within the developer_ou
from the dev_aws_account
. In terms of policies, I only have “FullAWSAccess” in “Service control policies” which is attached to Root.
Any input would be appreciated. Thanks!
OK, so I assume you’ve doubly checked you don’t have any additional SCPs in the hierarchy and FullAWSAccess hasn’t been modified?
If so, check if the role you are using has the necessary permissions (say, organizations:*
)
Correct. I don’t have any additional SCPs and FullAWSAccess hasn’t been modified. After going through all AWS Organizations documentation, I stumbled upon this section which talks about ownership. According to AWS, one can’t access organization resources from the member accounts.
That means I would have to assume a role in the management account from my dev account in order to create OUs in my sandbox/dev environment?
Learn about the permissions
Hi is there a way to see raw Prometheus metrics on AWS managed Prometheus?
i want to access AMP’s dashboard but i can’t
but i want to have access to Raw metrics
I am not sure about AWS Managed Grafana
Hi! im trying to create somre rds with this module cloudposse/rds/aws from a snapshot, this snapshot was replicated from another region. The problem is the original snapshot contains backup_retention_period = 1 (for replicate the snapshot in the terraform-test region). I dont need backups in the terraform-test region (expensive) If i try to put backup_retention_period to 0 terraform tries to set the retention period to 1 again, i want to ignore changes in backup_retention_period… so i tryied to modify the module and making a PR but “dynamic lifecycle ignore_chances” is not way posible, any ideas to work around this?
hi Paula, I’m building a No Code Terraform tool which can easily set up your database for you and provide you with Terraform code. Would you like to try it out and see if it can help you?
nice, i can try
2023-04-16
2023-04-17
2023-04-18
Hello! I’d love to get feedback from the channel on our open source launch. We’re launching IAMbic (IAM, but in code), it’s a multi-cloud control plane that simplifies IAM management in a GitOps workflow. It’s like Terraform for Cloud IAM, but designed to be way easier and support cool features like delegated temporary access/permissions, dynamic AWS permissions for a multi-account AWS role depending on the account, and other features. Right now we’re supporting AWS IAM, Identity Center, Okta, Azure AD, and Google Workspace. Here’s the GitHub. Would you use it?
Shift Cloud IAM left
FYI there’s an extra .
in the GitHub link
Shift Cloud IAM left
looks good :)ű
Anyone have any opinions they care to share about AWS’ Black Belt program?
2023-04-20
Hi all!
I’m currently working on integrating Amazon Cognito with my application and I’m attempting to send custom emails after specific user events occur. However, I have run into an issue while trying to trigger the CustomEmailSender function after using the adminCreateUser
API call in the pre-signup lambda. The lambda never executes and I am trying to figure out why. Note that the same lambda is executed and the confirmation code is sent successfully if I fire an forgot password event with the following aws-cli command: aws cognito-idp forgot-password --client-id myClientId --username [[email protected]](mailto:[email protected])
This is the block I use in the pre signup lambda to create a user:
const cognitoIdp = new CognitoIdentityServiceProvider();
return cognitoIdp.adminCreateUser(params).promise();
Sharing my CustomEmailSender lambda code below:
const base64 = require('base64-js');
const sendgrid = require('@sendgrid/mail');
const encryptionSDK = require('@aws-crypto/client-node');
const { getSecretValue, getParameterValue } = require('./helpers');
const { decrypt } = encryptionSDK.buildClient(
encryptionSDK.CommitmentPolicy.REQUIRE_ENCRYPT_ALLOW_DECRYPT
);
const generatorKeyId = process.env.KEY_ALIAS;
const keyIds = [process.env.KEY_ARN];
const keyring = new encryptionSDK.KmsKeyringNode({ generatorKeyId, keyIds });
const sendEmail = async (to, code, SendGridAPIKey, locale) => {
// Other locales should come here.
let parameterStorePath;
if (locale === 'he') {
parameterStorePath = process.env.SENDGRID_FORGOT_PASSWORD_HE_TEMPLATE_ID_PARAMETER_PATH;
} else {
parameterStorePath = process.env.SENDGRID_FORGOT_PASSWORD_EN_TEMPLATE_ID_PARAMETER_PATH;
}
const templateName = encodeURIComponent(parameterStorePath);
const templateId = await getParameterValue(templateName);
const email = {
to: to,
from: '[email protected]',
templateId: templateId,
dynamicTemplateData: {
password_reset_link: code,
},
subject: 'Cognito Identity Provider registration completed',
};
try {
sendgrid.setApiKey(SendGridAPIKey);
await sendgrid.send(email);
console.log(`Email sent to ${to}`);
} catch (err) {
console.error(`Error sending email to ${to}: ${err}`);
throw err;
}
};
exports.lambdaHandler = async (event) => {
console.info(`userPoolId: ${event.userPoolId}`)
console.info(`triggerSource: ${event.triggerSource}`)
console.info(`event: ${JSON.stringify(event)}`)
console.info(`request: ${JSON.stringify(event.request)}`)
if (event.triggerSource === 'CustomEmailSender_ForgotPassword') {
await handleForgotPassword(event.request)
} else {
console.error(`Unsupported triggerSource: ${event.triggerSource}`)
}
return event;
};
const handleForgotPassword = async (request) => {
const sendGridSecretName = process.env.SENDGRID_API_KEY_SECRET_NAME
const sendGridApiKey = await getSecretValue(sendGridSecretName);
// decrypt confirmation code
let confirmationCode
if (request.code) {
const { plaintext } = await decrypt(
keyring,
base64.toByteArray(request.code)
)
confirmationCode = plaintext
}
if (!confirmationCode) {
console.error('failed to decrypt confirmation code')
return
}
// send email by SendGrid
await sendEmail(
request.userAttributes.email,
Buffer.from(confirmationCode).toString('utf-8'),
sendGridApiKey,
request.userAttributes.locale
)
}
anyone use twingate to grant access to AWS resources?
i have used it in past life by creating a IAM policy with checking the Twingate IP addresses . If folks were not logged by the VPN then they wouldn’t be able to do anything although access into Console was still possible
2023-04-21
2023-04-22
2023-04-23
2023-04-25
Hi all, is there any lampda available for deleting the old snapshots in our repo??
2023-04-26
hello all, for aws site to site vpn do I still need static IP or can I set it with dynamic ?
we had 8 mins outage on rds aurora serverless v1. I see only this in log:
Your Aurora Serverless DB cluster has automatically recovered.
any advice to prevent this in future?
Hey friends, I wanted to share a quick tip for anyone looking to extract permissions after an AWS installation. I created a Python script and wrote an article on Medium that explains how to easily find the permissions using CloudTrail. If you’re in need of something like this, here’s the link. https://medium.com/@diego_maia/discovering-used-permissions-creating-dynamic-aws-iam-policies-with-python-27e089097b81
Sometimes, we find ourselves navigating through complex tasks that require a more specific approach. One day, you may face challenges such…
Hi @Diego Maia it looks like this is granting perms for all resources “*” for every call made to the service within that window. Does this not result in a policy that is far more permissive than the sum of the calls that happen during the collection window, which would have been made against a targeted set of resources?
Sometimes, we find ourselves navigating through complex tasks that require a more specific approach. One day, you may face challenges such…
Hi @KrisM Yes, I agree that it’s too permissive. However, this is just the initial version. In this first phase, we’re only collecting the set of services per action. We plan to evolve the script to generate a higher level of detail, which will allow even greater granularity. Thank you very much for your comment, I’ll work on that.
2023-04-27
in organization suspended an account. when it will vanish from the list ? How can I delete it totally ?
https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html
It takes 90 days for the account to be completely deleted. I have in AWS Organizations made a OU called Archive where I move deleted accounts to get them out of my usual views
Close, delete, or suspend an AWS account that you no longer need.
thanks it is a good idea. will do the same