Skip to content

ayofishr/actions-hello

Repository files navigation

Requirements

No requirements.

Providers

Name Version
archive n/a
aws n/a

Modules

No modules.

Resources

Name Type
aws_api_gateway_deployment.handson_deployment resource
aws_api_gateway_integration.lambda_integration resource
aws_api_gateway_method.route_methods resource
aws_api_gateway_method_response.route_method_responses resource
aws_api_gateway_resource.handson resource
aws_api_gateway_resource.root resource
aws_api_gateway_rest_api.handson resource
aws_iam_policy.policy resource
aws_iam_role.handson resource
aws_iam_role_policy_attachment.api_gateway resource
aws_iam_role_policy_attachment.handson resource
aws_lambda_function.lambda_functions resource
archive_file.lambda_archives data source

Inputs

Name Description Type Default Required
lambda_functions n/a
map(object({
function_name = string
handler = string
source_code_path = string
}))
n/a yes
name_role n/a any n/a yes
region n/a any n/a yes
routes n/a
map(object({
method = string
path = string
}))
n/a yes

Outputs

Name Description
api_gateway_urls n/a

list action for deploy on gitlabci

requirement aws

create oidc

oidc

create role

IAM ROLE

add trust relationship on custom trust policy

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Federated": "arn_oidc"
                },
                "Action": "sts:AssumeRoleWithWebIdentity",
                "Condition": {
                    "StringEquals": {
                        "gitlab.revolve.team:sub": "project_path:name_orga/name_repo:ref_type:branch:ref:branch_name"
                    }
                }
            }
        ]
    }

change:

  • arn_oidc
  • name_orga
  • name_repo
  • branch_name (default main)

add policie for deploy terraform

requirement gitlabci

download zip here

create repo on gitlabci

add variable on project in gitlabci settings/cicd:

  • ROLE_ARN

variable

gitlab - Jenkins

create repo gitlab

create personal access token

create iam role on your aws account with custom trust policie

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "AWS": "arn:aws:iam::897644935672:role/ecs_task_execution_role"
                },
                "Action": "sts:AssumeRole"
            }
        ]
    }

add policie on your role for deploy terraform

send arn iam role for authorize jenkins to assume your role

create credentials jenkins administrer:

  • click jenkins/credentials/system/identifiants globaux/add creation

  • create secret gitlab on jenkins with id on specify with your name for sample

secret_gitlab_jenkins

  • create secret aws on jenkins with id on specify with your name for sample specifies your role create on aws

jenkins_aws_credentials

create multibranche pipeline jenkins:

  • click new item
  • choose name
  • choose multibranch pipeline
  • click add on branch sources choose gitlab project
  • choose your Checkout Credentials
  • fill owner
  • choose your project
  • add parameters Filter by name and fill main on Include
  • choose other parameters if necessary

new_item_jenkins mutli_brache_pipeline_parameters modify Jenkinsfile with id credentials aws

About

ekjrkej

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published