Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add experience for creating AWS EC2 instance with all the necessary network configurations #122

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/add_configure_ec2_experience.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Add experience for creating AWS EC2 instance with all the necessary network configurations.
Empty file.
4 changes: 4 additions & 0 deletions extensions/experiences/configure_ec2/group_vars/all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
organization: Default
# Github PAT
scm_credential: "UserGHPAT"
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
- name: Create AWS EC2 instance with the necessary network configurations
hosts: localhost
gather_facts: false
tasks:
- name: Configure Network resources
ansible.builtin.include_role:
name: cloud.aws_ops.ec2_networking_resources
vars:
ec2_networking_resources_vpc_name: "{{ vpc_name }}"
ec2_networking_resources_vpc_cidr_block: "{{ vpc_cidr }}"
ec2_networking_resources_subnet_cidr_block: "{{ subnet }}"
ec2_networking_resources_sg_internal_name: "{{ security_group_internal }}"
ec2_networking_resources_sg_internal_description: "{{ security_group_internal_description }}"

- name: Configure AWS EC2 instance
ansible.builtin.include_role:
name: cloud.aws_ops.ec2_instance_create
vars:
ec2_instance_create_aws_region: "{{ region }}"
ec2_instance_create_instance_name: "{{ instance_name }}"
ec2_instance_create_instance_type: "{{ instance_type }}"
ec2_instance_create_ami_id: "{{ ami_id }}"
ec2_instance_create_vpc_subnet_id: subnet-071443aa123456789
ec2_instance_create_tags:
Component: my-test-instance
Environment: Testing
ec2_instance_create_wait_for_boot: true
41 changes: 41 additions & 0 deletions extensions/experiences/configure_ec2/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# Labels
#
controller_labels:
- name: cloud.aws_ops
organization: "{{ organization }}"
- name: confgiure_ec2_experience
organization: "{{ organization }}"
- name: run_configure_ec2
organization: "{{ organization }}"

# Projects
#
controller_projects:
- name: AWS Operations / Configure EC2 Experience Project
organization: "{{ organization }}"
scm_branch: main
scm_clean: 'no'
scm_delete_on_update: 'no'
scm_type: git
scm_update_on_launch: 'no'
scm_credential: "{{ scm_credential }}"
scm_url: https://github.com/GomathiselviS/cloud.aws_ops.git


# Job Templates
#
controller_templates:
- name: AWS Operations / Configure EC2 instance
description: This job template creates an EC2 instance with the necessary network infrastructure
project: AWS Operations / Configure EC2 Experience Project
playbook: extensions/experiences/configure_ec2/playbooks/run_configure_ec2.yaml
job_type: "run"
organization: "{{ organization | default('Default') }}"
labels:
- cloud.aws_ops
- configure_ec2_experience
- run_configure_ec2

Check failure on line 38 in extensions/experiences/configure_ec2/setup.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[trailing-spaces]

Trailing spaces
credentials: aws-instance
survey_enabled: true
survey_spec: "{{ lookup('file', experience.path.replace('setup.yml', '') + 'template_surveys/configure_ec2.yaml') | from_yaml }}"
Empty file.
Loading