ABF - The Asset Bundle Factory
Setup
Locally
When running locally, such as for testing, run-
make clone
If you want to pull in the latest versions of the AssetBundler repositories-
make reclone
Downstream
If you are not running in this repository directly there's a few steps to take.
- Create a directory.
- Set the environment variable
BUNDLE_DIRECTORYto the newly created directory. - Do a full clone of the
terraform-aws-corebundle into that directory.
Usage
The top level object is a AssetRepository.
from abf import AssetRepository
import tempfile
AWSRepo = AssetRepository("aws")
# you can specify a tag (with get_asset_bundle_by_version), ex: v0.4.1
# you can also specify a ref (with get_asset_bundle_by_ref): ex: like "main" branch for development purposes
bundle = AWSRepo.get_asset_bundle_by_version("rds", "0.4.1")
# or
bundle = AWSRepo.get_asset_bundle_by_ref("rds", "main")
# Note these return the classes themselves, not an instance of the class.
ParameterValidationClass = bundle.get_parameter_validator()
PlanValidationClass = bundle.get_plan_validator()
AcceptanceValidationClass = bundle.get_acceptance_validator()
# Temporary directories disappear outside of the context.
# This means all operations have to be enclosed in the with block.
# Use a permanent directory if that is a problem.
with tempfile.TemporaryDirectory() as workdir:
# Returns a TerraformWorkspace from terrapy. By default it will drop you in an `executioner` workspace
workspace = bundle.get_fresh_workspace(workdir)
# Tell the bundle which state backend to use.
workspace.set_backend("s3", {
"bucket": "my_state_bucket",
"key": "my_state_file.state"
"dynamodb_table": "state_locks"
"region": "us-east-1",
})
workspace.init()
workspace.plan()
Environment variables
ABF_DISABLE_HARDLINKS- disable hard links on git checkout and skip using the--localflag
FAQ
- On a Mac using docker volumes in a fully dockerized local setup, you may run into this error:
Cloning into '/tmp/<TMP DIRECTORY>/aws/v0.18.0'...\nfatal: failed to create linkfrom a stderr output when ABF is running git operations. To fix this, you can disable hardlinks with an environment variable here:ABF_DISABLE_HARDLINKS='true'
Metadata
Release files for AssetBundleFramework 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| AssetBundleFramework-0.3.0.tar.gz | 14.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| AssetBundleFramework-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.6 kB
Release files / AssetBundleFramework-0.3.0.tar.gz
| Download URL | AssetBundleFramework-0.3.0.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b834b279fdcfa435f29999e26df050a4913633e14a556172c6b4754220de3a9d
|
|
BLAKE2b-256 checksum How to use checksums |
968212c5677ca7947578dbca5e0559040fc6fffc6ef998fea0c6f8d6d595eb2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / AssetBundleFramework-0.3.0-py3-none-any.whl
| Download URL | AssetBundleFramework-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3834404aff286a527d6f7f8d47cca4ec87fac50687cd5a3ff4a93eb72203c545
|
|
BLAKE2b-256 checksum How to use checksums |
569c74c717d62cdaf49679755525d63ee60b577ec725cd73f0c2766663e14fa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|