Skip to content

Commit

Permalink
Merge pull request #3 from ExitoLab/feature/fix-ec2-instance
Browse files Browse the repository at this point in the history
feat: fixed wrong public key and added workflow for release
  • Loading branch information
ExitoLab authored May 1, 2021
2 parents 50e2ee2 + 07f76cd commit 835137e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/generate-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Workflow for Bump version and creating tag
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v5.5
with:
github_token: ${{ secrets.GIT_TOKEN }}
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
5 changes: 3 additions & 2 deletions ec2-instance/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#create key pair on aws
resource "aws_key_pair" "ssh_key" {
key_name = "ssh_key"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8NyvLUwuxWKC1BHOfCi+3YNupLZiOCL1RfRiP1ZSF2GnZdvdKsSkKwE4JCwe47y6QE3BL7LKouvy0P84VkqulVl6x1mSBmhTMg3c2Rngd8A2kQ3zNtTJCRWSfk12yo5ySKynteaKz0xj/AEm5XkMaOml9wagiLg30W0JLBOAqxVsspgRjASnajdCizperQ/CdSoSf3XGpCymlgXvFnBMJN9DNrgCBg16bJ0h1xKF+7iyxgJ1Ygw2C+4FEnVMKnmwmuA28qbxaBmmrRP+5jre/fSDchhtvSHkn8IhiRArICIWhgNF26sVyIOQAkGmvtcwmDX/pXqzIEYuq6vqOIne5nHJORFP2FFyvOpjynt9bj3fzBTwyK+mKXFZqBINmW+RdObs0puyEKLP28harC+xzIfkdKIpGWtKV++DtK1LBTdlxP9kcQhf13PvC2+BSh1+6n7FvTsYY6xhli+7KhAEz0afsPZuGcWvoqSYhrKsDAl7sfNrQgrdxuLgfYOWYAos= toksy@Iges-MacBook-Pro.local"
public_key = "${var.public_key}"
tags = local.tags
}

Expand Down Expand Up @@ -53,5 +53,6 @@ resource "aws_instance" "app_server" {
user = "ec2-user"
private_key = file(var.private_key_path)
}
}

tags = local.tags
}
5 changes: 5 additions & 0 deletions ec2-instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ variable "ssh_key_name" {
description = "ssh key name"
type = string
}

variable "public_key" {
description = "public_key to the ec2 instance"
type = string
}
3 changes: 2 additions & 1 deletion ec2-instance/vars/dev.tfvars
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
private_key_path = "/Users/toksy/.ssh/id_rsa"
ssh_key_name = "ssh_key"
ssh_key_name = "ssh_key"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCjPYVnLZlwMpZw/q9fQpdeR4+JTqbd5E1zG+lWIkQqm44dT+hmsOCYKpEZcvzN7cucFkzkQh5ghd4qWveUWnfSM1zubHTN5xCup3rpIL5qopKlps/ggzMgVKIA1UVDaEMZm9ZVo7PH46T27LMlxoxfZTjqrpRm9UDwj1DjQr2kDzCWnGsolSG1BmCPXdYaik+UTGrqilwPui8hBBP9J//USlE6T6MfrUxr846PMj1imHdJ7bUhGPV/Z+/Vg1IkE+z0iw/7vfMFLdztNVqJLgx+RL3fLvtUb1Naws6uPdQeBeQf7htRhBjSW/qFa1ZcaXwGR1VMzHbpFAE6nuCQKkpgRLGV060qYJfdeNqZ4cdyXob+6W/froFaPCl9u6uv7gsQ9jui1B3Iv4jBUbYIZdsg+wWrf2mLwjZSa33f6W0JiOSuLhuZVPES+Fm27j7vE+dv92p0IQiljXW9myqV7k4SzjekaP2Z8yawN04jXHHVA5I54mYthTi1AJ8AduZ3OmFlmsye2YwbscGaQ3MJJOOKv0Uyl/nwavjugZbF0EAys7HjrOGPE8DX7mNVlwyv5VLfQKhy8gblD/fovi39VAGi1uXRSIJE5zUw8sZjV6koWPnmYXo1xdUOFPXKWHMSVfvHbiCuTL4fNxjQTZaMjBVmRud8VsWynekwwQgtzeiQQQ== igeadetokunbo@gmail.com"

0 comments on commit 835137e

Please sign in to comment.