From 8aa1cba088f8c614806f87b243afa6d7eeb89767 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 15 Feb 2024 20:55:12 +0100 Subject: [PATCH] chore: improve commands examples after field experience --- knowledge base/cloud computing/aws/cli.md | 3 ++- knowledge base/cloud computing/aws/ec2.placeholder | 2 ++ knowledge base/cloud computing/aws/ecr.md | 4 ++++ knowledge base/cloud computing/aws/s3.md | 11 +++++++++++ knowledge base/pulumi.md | 13 +++++++++++++ 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 knowledge base/cloud computing/aws/ec2.placeholder diff --git a/knowledge base/cloud computing/aws/cli.md b/knowledge base/cloud computing/aws/cli.md index c6b1329..9f16511 100644 --- a/knowledge base/cloud computing/aws/cli.md +++ b/knowledge base/cloud computing/aws/cli.md @@ -33,7 +33,8 @@ aws sagemaker list-endpoint-configs --output 'yaml-stream' --query 'EndpointConf aws sagemaker list-endpoint-configs --output 'json' --query 'EndpointConfigs[].EndpointConfigName' | jq -r '.[]' - # Describe all SageMaker EndpointConfigurations. -aws sagemaker list-endpoint-configs … | xargs -n '1' aws sagemaker describe-endpoint-config --endpoint-config-name +aws sagemaker list-endpoint-configs … \ +| xargs -n '1' aws sagemaker describe-endpoint-config --endpoint-config-name # List secrets stored in Secret Manager. diff --git a/knowledge base/cloud computing/aws/ec2.placeholder b/knowledge base/cloud computing/aws/ec2.placeholder new file mode 100644 index 0000000..6fec3a8 --- /dev/null +++ b/knowledge base/cloud computing/aws/ec2.placeholder @@ -0,0 +1,2 @@ +https://instances.vantage.sh/ +https://ec2instances.github.io/ diff --git a/knowledge base/cloud computing/aws/ecr.md b/knowledge base/cloud computing/aws/ecr.md index 507e36b..74715ce 100644 --- a/knowledge base/cloud computing/aws/ecr.md +++ b/knowledge base/cloud computing/aws/ecr.md @@ -46,6 +46,10 @@ aws ecr validate-pull-through-cache-rule \ docker pull 'aws_account_id.dkr.ecr.region.amazonaws.com/prefix/repository_name/image_name:tag' docker pull '123456789012.dkr.ecr.us-east-2.amazonaws.com/ecr-public/repository_name/image_name:tag' docker pull '123456789012.dkr.ecr.eu-west-1.amazonaws.com/quay/argoproj/argocd:v2.10.0' +# DockerHub cache repositories require the full path. +# E.g., 'library/alpine' instead of just 'alpine'. +docker pull '123456789012.dkr.ecr.eu-south-1.amazonaws.com/docker-hub/library/nginx:perl' +docker pull '123456789012.dkr.ecr.us-west-2.amazonaws.com/docker-hub/grafana/grafana' ``` ## Pull through cache feature diff --git a/knowledge base/cloud computing/aws/s3.md b/knowledge base/cloud computing/aws/s3.md index fda4594..0a73a03 100644 --- a/knowledge base/cloud computing/aws/s3.md +++ b/knowledge base/cloud computing/aws/s3.md @@ -64,6 +64,14 @@ aws s3 sync '.' 's3://arn:aws:s3:us-west-2:123456789012:accesspoint/myaccesspoin aws s3 rb 's3://my-bucket' aws s3 rb 's3://my-bucket' --force + +# Lifecycle configurations. +aws s3api get-bucket-lifecycle-configuration --bucket 'bucketName' +aws s3api put-bucket-lifecycle-configuration --bucket 'bucketName' \ + --lifecycle-configuration 'file://lifecycle.definition.json' +aws s3api delete-bucket-lifecycle-configuration --bucket 'bucketName' + + # Show tags on objects. aws s3api list-objects-v2 \ --bucket 'my-bucket' --prefix 'someObjectsInHereAreTagged' \ @@ -89,6 +97,9 @@ aws s3 delete-bucket-lifecycle --bucket 'batman' ## Lifecycle configuration +> Adding, removing or changing lifecycle rules takes a while.
+> Wait a couple of minutes after the operation to make sure all the bucket's properties are synced. + When one has multiple rules in an S3 Lifecycle configuration, an object can become eligible for multiple S3 Lifecycle actions. In such cases, Amazon S3 follows these general rules: 1. Permanent deletion takes precedence over transition. diff --git a/knowledge base/pulumi.md b/knowledge base/pulumi.md index 87e6723..7cde74b 100644 --- a/knowledge base/pulumi.md +++ b/knowledge base/pulumi.md @@ -69,6 +69,8 @@ pulumi config get # Set up secrets. pulumi config set --secret 'dbPassword' 'S3cr37' +pulumi config set --secret 'ecr:dockerHub' \ + '{"username":"marcus","accessToken":"dckr_pat_polus"}' # Read secrets. pulumi config get 'dbPassword' @@ -109,10 +111,21 @@ pulumi stack ls pulumi stack ls -o 'organization' -p 'project' -t 'tag' pulumi stack ls -a +# Create graphs of the dependency relations. +pulumi stack graph 'path/to/graph.dot' +pulumi stack graph -s 'dev' 'dev.dot' --short-node-name + # Delete stacks. pulumi stack rm pulumi stack rm -fy pulumi stack rm --preserve-config --yes --stack 'stack' + + +# Rename resources in states. +pulumi rename 'resourceUrn' 'newName' + +# Unprotect resources that are protected in states. +pulumi state unprotect 'resourceUrn' ```