### Installing awacs using pip Source: https://github.com/cloudtools/awacs/blob/main/README.rst This command installs the awacs library using pip, the Python package installer. It's the recommended and simplest way to get awacs set up in your environment. ```sh $ pip install awacs ``` -------------------------------- ### Installing awacs using setup.py Source: https://github.com/cloudtools/awacs/blob/main/README.rst This command installs the awacs library directly from the source code using setup.py. This method is typically used after cloning the repository for development or custom installations. ```sh $ python setup.py install ``` -------------------------------- ### Updating AWS Actions with Scraper Tool in Shell Source: https://github.com/cloudtools/awacs/blob/main/README.rst These shell commands outline the process for updating AWS actions within the awacs repository using a scraping tool. It involves installing dependencies, installing the awacs package, running the scraper script, and then reviewing the changes with `git diff`. ```sh $ python3 -m pip install -r scrape/requirements.txt $ python3 -m pip install . $ python3 ./scrape/scrape.py $ git diff ``` -------------------------------- ### Example AWS S3 Policy Document in JSON Source: https://github.com/cloudtools/awacs/blob/main/README.rst This JSON snippet represents the AWS IAM policy generated by the preceding Python code. It grants an AWS IAM user (`arn:aws:iam::123456789012:user/Bob`) full access (`s3:*`) to objects within the `my_corporate_bucket` S3 bucket. ```json { "Id": "S3-Account-Permissions", "Statement": [ { "Action": [ "s3:*" ], "Effect": "Allow", "Principal": [ { "AWS": [ "arn:aws:iam::123456789012:user/Bob" ] } ], "Resource": [ "arn:aws:s3:::my_corporate_bucket/*" ], "Sid": "1" } ], "Version": "2012-10-17" } ``` -------------------------------- ### Building Python Distribution Packages Source: https://github.com/cloudtools/awacs/blob/main/RELEASE.md This command uses the `build` module to create source distribution (`sdist`) and wheel (`wheel`) packages for the current Python project. These packages are necessary for distributing the library to package indexes like PyPI. ```bash python -m build --sdist --wheel . ``` -------------------------------- ### Uploading Python Distribution Packages with Twine Source: https://github.com/cloudtools/awacs/blob/main/RELEASE.md This command uploads the validated source and wheel distribution packages to a package index (e.g., PyPI) using `twine`. The `-s` flag ensures the upload is signed, enhancing security and trust. ```bash twine upload -s dist/awacs-1.1.1*[.whl,.gz] ``` -------------------------------- ### Creating a Signed Git Tag for Release Source: https://github.com/cloudtools/awacs/blob/main/RELEASE.md This command creates a cryptographically signed Git tag for a new release version. The `--sign` flag ensures the tag is signed, and the `-m` flag provides an annotated message for the tag. This is crucial for verifying the authenticity of releases. ```bash git tag --sign -m "Release 1.1.1" 1.1.1 ``` -------------------------------- ### Checking Python Distribution Packages with Twine Source: https://github.com/cloudtools/awacs/blob/main/RELEASE.md This command uses `twine` to validate the integrity and metadata of the generated distribution packages (wheel and gzipped source archive) before uploading them. It helps catch potential issues early. ```bash twine check dist/awacs-1.1.1*[.whl,.gz] ``` -------------------------------- ### Generating CHANGELOG Entries from Git Log Source: https://github.com/cloudtools/awacs/blob/main/RELEASE.md This helper command generates a formatted list of recent Git commit messages suitable for a `CHANGELOG.md` file. It reverses the log, formats messages, takes the last 100, and prefixes each with an asterisk. ```bash git log --reverse --pretty=format:"%s" | tail -100 | sed 's/^/* /' ``` -------------------------------- ### Pushing Git Tags to Remote Source: https://github.com/cloudtools/awacs/blob/main/RELEASE.md This command pushes all local Git tags to the configured remote repository. This is essential for making release tags visible and accessible to others. ```bash git push --tags ``` -------------------------------- ### Pushing Git Commits to Remote Source: https://github.com/cloudtools/awacs/blob/main/RELEASE.md This command pushes all local commits on the current branch to the configured remote repository. It synchronizes the local changes with the central codebase. ```bash git push ``` -------------------------------- ### Creating an AWS S3 Policy Document in Python Source: https://github.com/cloudtools/awacs/blob/main/README.rst This Python snippet demonstrates how to construct an AWS IAM policy document for an S3 bucket using the awacs library. It defines a statement allowing an IAM user full S3 access to a specific bucket, then prints the generated policy as JSON. ```python from awacs.aws import Action, Allow, PolicyDocument, Principal, Statement from awacs.iam import ARN as IAM_ARN from awacs.s3 import ARN as S3_ARN account = "123456789012" user = "user/Bob" pd = PolicyDocument( Version="2012-10-17", Id="S3-Account-Permissions", Statement=[ Statement( Sid="1", Effect=Allow, Principal=Principal("AWS", [IAM_ARN(user, '', account)]), Action=[Action("s3", "*")], Resource=[S3_ARN("my_corporate_bucket/*"),], ), ], ) print(pd.to_json()) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.