Package: pcf
Particle Cloud FrameworkParticle Cloud Framework is a cloud resource provisioning framework that is fully customizable and extensible, callable by code, and does not require manually maintaining states of resources. Particle Cloud Framework enables the standardization of modeling hierarchical cloud infrastructure, automating deployments, and managing lifecycles of cloud resources.DocsDocsincluding quickstart and developer guideInstallationTo install particle cloud framework, open an interactive shell and run:pip install pcfImport and use a PCF ParticleFirst import the particles you will use. These can be core particles or custom particles that you created.
See examples if you need help creating your config.from pcf.core.ec2.ec2_instance import EC2InstanceNext we need to pass the desired state definition to the particle.ec2_example_definition = {
        "pcf_name": "ec2_example",
        "flavor":"ec2",
        "aws_resource": {
            "ImageId": "ami-xxxxx",
            "InstanceType": "t2.micro",
            "KeyName": "secret-key-xxx",
            "SecurityGroupIds": [
              "sg-xxxxxx",
            ],
            "SubnetId": "subnet-xxx",
            "userdata_template_file": "userdata-script-xxxxx.sh",
            "userdata_params": {},
            "IamInstanceProfile": {
              "Arn": "arn:aws:iam::xxxxxxxxx"
            },
            "InstanceInitiatedShutdownBehavior": "stop",
            "tags": {
              "NAME":"Value"
            },
            "BlockDeviceMappings": [
              {
                "DeviceName": "/dev/sda1",
                "Ebs": {
                  "DeleteOnTermination": true,
                  "VolumeSize": 20,
                  "VolumeType": "gp2"
                }
              }
            ]
          }
    }Now to start the ec2 instance using pcf simply initialize the particle and set the desired state to running and apply.particle = EC2Instance(ec2_example_definition)

    particle.set_desired_state('running')
    particle.apply()To terminate simply change the desired state to terminated and apply.particle.set_desired_state('terminated')
    particle.apply()Published ContentJust in Time Cloud Infrastructure:
Redefining the Relationship Between Applications and Cloud InfrastructureSupported Cloud ServicesParticlesQuasiparticlesDevelopment SetupTo develop locally, clone this project and ensure you have the Invoke package installed globally viapiporconda:$ pip install invokeor$ conda install invokeThen you can use the project management tasks defined intasks.pyvia theinvokeCLI:$ invoke --list
Available tasks:

  build      Build PCF with the PCF_TAG value given or the VERSION in pcf/__init__.py
  docs-add   Run sphinx-apidoc on pcf and pcf/test
  lint       Run pylint on pcf directory
  publish    Publish package to Pypi
  setup      Setup a virtualenv, activate it, and install requirements
  test       Run pytest on pcf directory, generating a coverage report

$ invoke setup && source venv/bin/activate
$ invoke testRoadMapRoadmapContributorsWe welcome Your interest in Capital One’s Open Source Projects (the
“Project”). Any Contributor to the Project must accept and sign an
Agreement indicating agreement to the license terms below. Except for
the license granted in this Agreement to Capital One and to recipients
of software distributed by Capital One, You reserve all right, title,
and interest in and to Your Contributions; this Agreement does not
impact Your rights to use Your own Contributions for any other purpose.Sign the Individual AgreementSign the Corporate AgreementCode of ConductThis project adheres to theOpen Code of ConductBy participating, you are
expected to honor this code.