{"id":20904982,"url":"https://github.com/devopsartfactory/goployer","last_synced_at":"2025-07-23T12:35:43.406Z","repository":{"id":45433802,"uuid":"262697781","full_name":"DevopsArtFactory/goployer","owner":"DevopsArtFactory","description":"AWS Deployer with Go","archived":false,"fork":false,"pushed_at":"2025-03-12T01:22:26.000Z","size":98316,"stargazers_count":72,"open_issues_count":11,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-24T04:08:36.769Z","etag":null,"topics":["aws","cicd","deployer","deployment","goployer"],"latest_commit_sha":null,"homepage":"https://goployer.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevopsArtFactory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-10T02:33:22.000Z","updated_at":"2025-03-13T00:29:39.000Z","dependencies_parsed_at":"2024-01-13T15:58:02.333Z","dependency_job_id":"5a8d79ab-934d-4a9f-a087-e27b8072575f","html_url":"https://github.com/DevopsArtFactory/goployer","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevopsArtFactory%2Fgoployer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevopsArtFactory%2Fgoployer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevopsArtFactory%2Fgoployer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevopsArtFactory%2Fgoployer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevopsArtFactory","download_url":"https://codeload.github.com/DevopsArtFactory/goployer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423730,"owners_count":20774820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cicd","deployer","deployment","goployer"],"created_at":"2024-11-18T13:20:14.061Z","updated_at":"2025-07-23T12:35:43.386Z","avatar_url":"https://github.com/DevopsArtFactory.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goployer\n`goployer` is an application you can use for EC2 deployment. You can deploy in a blue/green mode. goployer only\nchanges the autoscaling group so that you don't need to create another load balancer or manually attach autoscaling group to target group.\n\u003cbr\u003e\u003cbr\u003e\n\n## Demo\n![goployer-demo](static/base.gif)\n\n## # Requirements\n* You have to create a load balancer and target groups of it which goployer attach a new autoscaling group to. \n* If you want to setup loadbalancer and target group with terraform, then please check this [devopsart workshop](https://devops-art-factory.gitbook.io/devops-workshop/terraform/terraform-resource/computing/elb-+-ec2).\n* Please understand how goployer really deploys application before applying to the real environment.\n\u003cbr\u003e\n\n## # How goployer works\n* Here's the steps that goployer executes for deployment\n1. Generate new version for current deployment.\u003cbr\u003e\nIf other autoscaling groups of sample application already existed, for example `hello-v001`, then next version will be `hello-v002`\n2. Create a new launch template. \n3. Create autoscaling group with launch template from the previous step. A newly created autoscaling group will be automatically attached to the target groups you specified in manifest.\n4. Check all instances of all stacks are healty. Until all of them pass healthchecking, it won't go to the next step.\n5. (optional) If you add `autoscaling` in manifest, goployer creates autoscaling policies and put these to the autoscaling group. If you use `alarms` with autoscaling, then goployer should also create a cloudwatch alarm for autoscaling policy.\n6. After all stacks are deployed, then goployer tries to delete previous versions of the same application.\n   Launch templates of previous autoscaling groups are also going to be deleted.\n   \n\u003cbr\u003e\n\n## # Spot Instance\n* You can use `spot instance` option with goployer.\n* There are two possible ways to use `spot instance`.\n\n\n`instance_market_options` : You can set spot instance options and with this, you will only use spot instances.\n```yaml\n    instance_market_options:\n      market_type: spot\n      spot_options:\n        block_duration_minutes: 180\n        instance_interruption_behavior: terminate # terminate / stop / hibernate\n        max_price: 0.2\n        spot_instance_type: one-time # one-time or persistent\n```\n\u003cbr\u003e  \n  \n`mixed_instances_policy` : You can mix `on-demand` and `spot` together with this setting. \n  \n```yaml\n    mixed_instances_policy:\n      enabled: true\n      override_instance_types:\n        - c5.large\n        - c5.xlarge\n      on_demand_percentage: 20\n      spot_allocation_strategy: lowest-price\n      spot_instance_pools: 3\n      spot_max_price: 0.3\n```\n \nYou should see the detailed information in [manifest format](https://goployer.dev/docs/references/manifest/) page.\n\n\u003cbr\u003e\n\n## EBS Volume Configuration\n\nGoployer supports advanced EBS volume management with the following features. You can find a complete example in [api-test-example.yaml](examples/manifests/api-test-example.yaml).\n\n### Basic Configuration\n```yaml\nblock_devices:\n  - device_name: /dev/xvda\n    volume_size: 30\n    volume_type: gp3\n```\n\n### Delete on Termination\nControl whether EBS volumes should be deleted when the instance terminates:\n```yaml\nblock_devices:\n  - device_name: /dev/xvda\n    volume_size: 30\n    volume_type: gp3\n    delete_on_termination: false  # optional, defaults to false\n```\n\n### Snapshot Support\nCreate volumes from existing snapshots:\n```yaml\nblock_devices:\n  - device_name: /dev/sdf\n    snapshot_id: snap-1234567890abcdef0  # optional, for volume creation from snapshot\n    volume_size: 100\n    volume_type: gp3\n    delete_on_termination: true\n```\n\n### Encrypted Volumes\nCreate encrypted volumes with KMS:\n```yaml\nblock_devices:\n  - device_name: /dev/sdg\n    volume_size: 50\n    volume_type: gp3\n    encrypted: true\n    kms_alias: alias/my-kms-key\n    delete_on_termination: false\n```\n\n### Configuration Options\n- `device_name`: The device name to expose to the instance\n- `volume_size`: Size of the volume in GiB\n- `volume_type`: Type of EBS volume (gp2, gp3, io1, io2, st1, sc1)\n- `delete_on_termination`: Whether to delete the volume on instance termination (default: false)\n- `snapshot_id`: ID of the snapshot to create the volume from (optional)\n- `encrypted`: Whether to encrypt the volume (default: false)\n- `kms_alias`: KMS key alias for encryption (required if encrypted is true)\n\nFor a complete example showing how to use these features together, see [api-test-example.yaml](examples/manifests/api-test-example.yaml).\n\n\n\u003cbr\u003e\n\n## # Network Interface Configuration\n* You can configure multiple network interfaces (ENIs) for your instances.\n* Both primary and secondary ENIs are optional configurations.\n* If not specified, default network interface settings will be used.\n\n### Security Group Configuration\nSecurity groups can be configured in three ways:\n\n1. Using Launch Template Security Groups (Default):\n```yaml\nsecurity_groups:\n  - sg-12345678\n```\n\n2. Using Primary ENI Security Groups (Optional):\n```yaml\nprimary_eni:\n  device_index: 0\n  subnet_id: subnet-12345678\n  security_groups:\n    - sg-12345678\n```\n\n3. Using Multiple ENIs with Security Groups (Optional):\n```yaml\nprimary_eni:\n  device_index: 0\n  subnet_id: subnet-12345678\n  security_groups:\n    - sg-12345678\n\nsecondary_enis:\n  - device_index: 1\n    subnet_id: subnet-87654321\n    security_groups:\n      - sg-87654321\n    private_ip_address: 10.0.1.100\n  - device_index: 2\n    subnet_id: subnet-87654321\n    security_groups:\n      - sg-87654321\n    private_ip_address: 10.0.1.101\n```\n\nNote: \n- You cannot use both ENI security groups and launch template security groups at the same time. You must choose either:\n  * Using launch template security groups (without ENI)\n  * Using ENI security groups (with ENI)\n- Security group IDs must start with 'sg-' prefix\n- ENI configuration is optional and should be used only when you need specific network interface configurations\n- Each ENI (primary and secondary) must have at least one security group specified\n\n### Network Interface Parameters\n* `device_index`: The index of the network interface (0 for primary, 1+ for secondary)\n* `subnet_id`: The ID of the subnet to attach the ENI to\n* `security_groups`: List of security group IDs to associate with the ENI\n* `private_ip_address`: (Optional) Specific private IP address to assign to the ENI\n* `delete_on_termination`: \n  - If `true`: The ENI will be automatically deleted when the instance is terminated\n  - If `false`: The ENI will be preserved when the instance is terminated, allowing you to reuse it with another instance\n  - Primary ENI typically uses `true` to clean up resources\n  - Secondary ENIs often use `false` to preserve network configurations and IP addresses\n\n## Examples\n* You can find few examples of manifest file so that you can test it with this.\n```bash\ncd examples/manifests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevopsartfactory%2Fgoployer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevopsartfactory%2Fgoployer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevopsartfactory%2Fgoployer/lists"}