Package: aim.models
aim.modelsAn object model for semantic cloud infrastructure.aim.modelsparses a directory of YAML files that compose an AIM Project and loads them
into a complete object model.What's in the model?The model defines common logical cloud infrastructure concepts, such as networks, accounts,
applications and environments.The model uses network and applications as hierarchical trees of configuration that can
have their values over rode when they are placed into environments. Environments live in a
network and contain applications, and typically represent the stages of the software development
lifecycle (SDLC), such as 'development', 'staging' and 'production'.The model has a declarative schema that explicitly defines the fields for each object type in the model.
This schema declares not only type (e.g. string, integer) but can also declare defaults, min and max values,
constrain to specific values, and define invariants that ensure that if one field has a specific value, another
fields value is compatabile with that. The model will validates these fields when it loads an AIM Project.DevelopingInstall this package with your Python tool of choice. Typically set-up a virtualenv
and pip install the dependencies in there:python -m venv env

./env/bin/pip install -e .There are unit tests using PyTest. If you are using VS Code you can turn on the
"Py Test Enabled" setting and run "Discover Unit Tests" command.Changelog for aim.models6.1.0 (2019-11-06)AddedApplications can be provisioned in the same environment more than once with a new
"app{suffix}" syntax for an environments application keys.INotificationGroups has a regions field, if it is the default of ['ALL'] it will apply to
all of a project's active regions. Otherwise is will just provision in the selected region(s).ICloudFormationInit for modelling AWS::CloudFormation::Init, which can be applied to
the IASG.cfn_init field.ICloudWatchLogAlarm schema. ICloudWatchAlarm now has "type: Alarm" and if it is "type: LogAlarm"
an ICloudWatchLogAlarm will be created which can be used to connect an alarm to a MetricFilter
of a LogGroup.IDBParameterGrouups resource.IElastiCache hasdescriptionandcache_clustersfields, while IElastiCacheRedis hassnapshot_retention_limit_daysandsnapshot_windowfields.IRDS has newlicense_model,cloudwatch_logs_exportanddeletion_protectionfields.global_role_namefield for IAM Role can be set to True and the RoleName
will not be hashed. Can only be used for global Roles, otherwise if these
Roles overlap per-environment, things will break!monitoring.health_checkswhich can contain HealthCheck Resources.
IRoute53HealthCheck resource for Route53 health checks.region_nameproperty can be overrode if aoverrode_region_nameattribute is set.Added a CodeBuild IAM Permission for IAM UsersAddedresolve_refmethod to DeploymentPipelineConfigurationAdded the EIP Application Resource and a support 'eip' field to the ASG resource for associating an EIP with a single instance ASG.Added AWS Cli install commands to vocabulary.Addeddnsto EIP Application ResourceAddedcftemplate_iam_user_delegates_2019_10_02legacy flag to make user delegate role stack names consistent with others.Addedroute53_hosted_zone_2019_10_12legacy flag for Route53 CFTemplate refactor.Addedroute53_record_set_2019_10_16legacy flag for the Route53 RecordSet refactor.Addedavailability_zonefor locking in an ASG to a single Availability Zone.Addedparameter_groupto IElastiCache Application ResourceAddedvpc_associationsto IPrivateHosted.Addedvpc_configto the ILambda Application ResourcesAddedsecrets_managerto IIEnvironmentDefault.Addedttlto IDNSAdded caching to instance AMI ID function.ref lookups.Added the EBS Application Resources.
Addedebs_volume_mountsto IASG to mount volumes to single instance groups.Addedlaunch_optionsto IASG as an IEC2LaunchOptions object. The initial option is update_packages which will update the linux distributions packages on launch.Added resolve_ref() to Resource in base.py as a catch all.ChangedISecurityGroupRulesource_security_groupwas moved to IIngressRule and IEgressRule (finally!)
has adestination_security_groupfield.load_resourceswas removed and you can now simply apply_attributes to
an Application and it will recurse through app.groups..resources.
without any external fiddling.Moved deepdiff CLI functions intoaimproject.IApplication is now IMonitorable. Alarms at the Application level must
specify their Namespace and Dimensions.Changed RDSprimary_domain_nameandprimary_hosted_zoneto an IDNS objectFixedAlarm overrides are now cast to the schema of the field. Fixes "threshold: 10" loading as in int()
when the schema expects a float().6.0.0 (2019-09-27)AddedICloudWatchAlarms haveenable_ok_actionsandenable_insufficient_data_actionsbooleans
that will send to the notification groups when the alarm enters the OK or INSUFFICIENT_DATA states.references.get_model_obj_refwill resolve an aim.ref to a model object
and won't attempt to do Stack output lookups.Service plug-ins are loaded according to aninitilization_orderinteger
that each plug-in can supply. If no integer is supplied, loading for unordered
plug-ins count up from 1000.Minimal API Gateway models for Methods, Resources, Models and Stages.S3Bucket NotificationConfiguration for Lambdas.S3Bucket hasget_bucket_name()to return the full computed bucket name.IGlobalResources for project['resource'] to contain config from the ./Resources/ directory.
Resources such as S3 and EC2 now implement INamed and are loaded into project['resource'].ISNSTopic hascross_account_accesswhich grantssns:Publishto all accounts in the AIM Project.IAccountContainer and IRegionContainer are lightweight containers for account and region information.
They can be used by Services that want to set-up Resources in a multi-account, multi-region manner.ChangedCloudTrail defines CloudWatchLogGroup as a sub-object rather than an aim.ref.Alarms haveget_alarm_actions_aim_refsrenamed fromget_alarm_actionsas alarms can only provide
aim.refs and need to get the ARNs from the stacks.NotificationGroups are now Resources. Now they have regular working aim.ref's.5.0.0 (2019-08-26)AddedNew fieldaim.models.reference.FileReferencewhich resolves the path and replaces
the original value with the value of the file indicated by the path.
IApiGatewayRestApi.body_file_location uses this new field.ApiGatewayRestApi and CloudWatchAlarm have acfn_export_dictproperty that
returns a new dict that can be used to created Troposphere resources.Added external_resource support to the ACMAdded ReadOnly support to the Administrator IAMUserPermissionChangedMulti-Dimension Alarms now need to specify anaim.refas the Value.Added IAMUser schemas and loading for IAM users.Added a CommaList() schema type for loading comma separated lists into schema.List()Moved aim reference generation into the Model. Model objects now have .aim_ref and
.aim_ref_parts properties which contain their aim.ref reference.Renamed project['ne'] to project['netenv']Modified NatGateway segments to aim referencesFixedInvariants were not being check for resources. Invariants need to be checked by the
loader if they are not contained in azope.schema.Objectfield, which will run the
check behind the scenes.4.0.0 (2019-08-21)AddedIVPCPeering and IVPCPeeringRoute have been added to the model for VPC Peering support.Added a CloudTrail schema configured inResources/CloudTrail.yaml.IS3BucketPolicy now hasprincipalandconditionfields.principalcan be either a Key-Value dictionary, where the key is either 'AWS', 'Service', etc.
and the value can be either a String or a List. It is an alternate to theawsfield, which will
remain for setting simpler AWS-only principals.
Theconditionfield is a Key-Value dictionary of Key-Value filters.Alarm now has 'get_alarm_actions' and 'get_alarm_description' to help construct alarms.CloudTrail has a 'get_accounts' which will resolve the CloudTrail.accounts field to a list
of Account objects in the model.IAlarm hasdescriptionandrunbook_urlfields.CodePipeBuildDeploy.resolve_ref() function covers wider scope of ref lookupsAdded VPCPeering to the model.Added IElastiCache and IElastiCacheRedis to the model.ChangedMonitorConfig/LogSets.yamlhas been renamed toMonitorConfig/Logging.yaml. CloudWatch
logging is under the top levelcw_loggingkey. The schema has been completely reworked
so that LogGroups and LogSets are properly modelled.IAccount.region, IEC2KeyPair.region and ICredentials.aws_default_region no longer haveus-west-2as a default. The region needs to be explicity set.FixedIAlarm.classification is now a required field.3.1.0 (2019-08-08)Addedaim-project-version.txt file in the root directory can now contain the AIM Project YAML
version. IProject now has an aim_project_version field to store this value.ICloudWatchAlarm gets a namespace field. Can be used to override the default
Resource namespace, for example, use 'CWAgent' for the CloudWatch agent metrics.IResource now has a resource_fullname field. The fullname is the name needed to
specify for a metric in a CloudWatch Alarm.ICloudWatchAlarm now has a dimensions field, which is a List of Dimension objects.ITargetGroup now inherits from IResource. It loads resource_name from outputs.3.0.0 (2019-08-06)AddedNewMonitorConfig/NotificationGroups.yamlthat contains subscription groups for notifications.sdb_cache field for Lambda.Lambda can have alarms.ISNSTopic and ISNSTopicSubscription to model SNS.ChangedAll references have been renamed to start withaim.reffor consistency.AlarmSets, AlarmSet and Alarm all now implement INamed and
are locatable in the modelService plugins can load their outputs2.0.0 (2019-07-23)AddedSchema for Notifications for subscribing to AlarmsAdded S3Resource for Resources/S3.yml configurationAdded Lambda resolve_ref supportChangedServices are loaded as entry_point plugins namedaim.servicesRefactored the models applications, resources, and services.Renamed IRoute53 to IRoute53Resource.FixedCloudWatchAlarms now validate a classification field value of
'performance', 'health' or 'security' is supplied.1.1.0 (2019-07-06)AddedAdded function.ref to be able to look-up latest AMI IDsAdded more constraints to the schemas.Added default to IS3Bucket.policyAdded Route53 to schema and modelAdded redirect to Listner rules in the ALBChangedDescription attribute for Fields is now used to describe constraints.Ported CodeCommit to schema and modelRefactored S3 to use Application StackGroupCPBD artifacts s3 bucket now uses S3 Resource in NetEnv yaml insteadConverted the ALB's listener and listener rules to dicts from listsRemovedRemoved unused yaml config from aimdemo under fixtures.1.0.1 (2019-06-19)Improvements to Python packaging metadata.1.0.0 (2019-06-19)First open source release