The design and endpoint concepts are inspired by AWS’s documentation for creating an external key store. AWS XKS Documentation
Details about managing keys and using cryptographic operations with Azure Key Vault Azure Key Vault Keys Overview.
| #!/bin/bash | |
| set -euo pipefail | |
| # Check for required commands: aws and jq. | |
| command -v aws >/dev/null 2>&1 || { echo "aws CLI is required but not installed. Exiting." >&2; exit 1; } | |
| command -v jq >/dev/null 2>&1 || { echo "jq is required but not installed. Exiting." >&2; exit 1; } | |
| usage() { | |
| cat <<EOF | |
| Usage: $0 [secret_name] |
| # install pipx | |
| python -m pip install --user pipx | |
| python -m pipx ensurepath | |
| sudo pipx ensurepath --global | |
| # install jupyterlab | |
| pipx install jupyterlab --include-deps | |
| pipx ensurepath | |
| # add common dependencies |
| AWSTemplateFormatVersion: 2010-09-09 | |
| Transform: AWS::LanguageExtensions | |
| Parameters: | |
| AlarmLambdaPairs: | |
| Type: CommaDelimitedList | |
| Description: | | |
| Comma-separated "prefix:lambdaName" pairs. Example: "PrefixA:MyLambdaA,PrefixB:MyLambdaB" | |
| Default: PrefixA:MyLambdaA,PrefixB:MyLambdaB |
The design and endpoint concepts are inspired by AWS’s documentation for creating an external key store. AWS XKS Documentation
Details about managing keys and using cryptographic operations with Azure Key Vault Azure Key Vault Keys Overview.
| import boto3 | |
| def delete_old_nodejs_lambdas(): | |
| client = boto3.client("lambda") | |
| deprecated_runtimes = {"nodejs12.x", "nodejs14.x", "nodejs16.x"} | |
| # Paginate through all Lambda functions | |
| paginator = client.get_paginator("list_functions") | |
| page_iterator = paginator.paginate() | |
| AWSTemplateFormatVersion: 2010-09-09 | |
| Description: Setup-Monitoring-On-AWS-Site-to-Site-VPN | |
| Parameters: | |
| UniqueName: | |
| Type: String | |
| Description: An unique qualifier | |
| AllowedPattern: ^[\\.\\-_/#A-Za-z0-9]{1,512} | |
| SnsTopicARN: | |
| Type: String | |
| Description: (Required) ARN of your SNS topic |
| import boto3 | |
| from botocore.exceptions import BotoCoreError, ClientError | |
| def assume_role_with_tags(aws_access_key, aws_secret_key, role_arn, session_name, tags): | |
| """ | |
| Assumes an AWS IAM Role with the specified tags. | |
| :param aws_access_key: AWS access key ID | |
| :param aws_secret_key: AWS secret access key | |
| :param role_arn: ARN of the role to assume |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Parameters: | |
| AccountId: | |
| Type: String | |
| Description: The AWS Account ID that can assume this role. | |
| RoleName: | |
| Type: String | |
| Description: The policy name that allows add or remove ips from ipsets | |
| Resources: |
When trying to build a Debian container, I encountered a bunch of errors like this upon running apt update:
W: GPG error: http://deb.debian.org/debian buster InRelease: At least one invalid signature was encountered.
E: The repository 'http://deb.debian.org/debian buster InRelease' is not signed.
The issue seems to be a lack of disk space. This StackOverflow answer was indeed correct: running docker image prune -f and docker container prune -f fixed the problem.
| python3 - <<EOF | |
| import boto3 | |
| ecr = boto3.client('ecr') | |
| repo_prefix = "dev-" | |
| # Paginate through repositories | |
| paginator = ecr.get_paginator('describe_repositories') | |
| for page in paginator.paginate(): | |
| for repo in page['repositories']: |