Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Commit c3ea2ba

Browse files
committed
Adding gitlab-projects-accesstoken to CICD
1 parent be0abae commit c3ea2ba

File tree

6 files changed

+56
-3
lines changed

6 files changed

+56
-3
lines changed
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
#
3+
# Clean up any prerequisites created in setup.sh
4+
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"Name": "TestAccessToken",
3-
"ProjectId": <PROJECT_ID>,
3+
"ProjectId": GITLAB_PROJECT_ID,
44
"AccessLevel": 30,
55
"Scopes": [
66
"api",
7-
"write_registry"
7+
"write_repository"
88
]
99
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
AWSTemplateFormatVersion: "2010-09-09"
2+
Description: >
3+
This CloudFormation template creates a role assumed by CloudFormation
4+
during CRUDL operations to mutate resources on behalf of the customer.
5+
6+
Resources:
7+
ExecutionRole:
8+
Type: AWS::IAM::Role
9+
Properties:
10+
MaxSessionDuration: 8400
11+
AssumeRolePolicyDocument:
12+
Version: '2012-10-17'
13+
Statement:
14+
- Effect: Allow
15+
Principal:
16+
Service: resources.cloudformation.amazonaws.com
17+
Action: sts:AssumeRole
18+
Path: "/"
19+
Policies:
20+
- PolicyName: ResourceTypePolicy
21+
PolicyDocument:
22+
Version: '2012-10-17'
23+
Statement:
24+
- Effect: Deny
25+
Action:
26+
- "*"
27+
Resource: "*"
28+
Outputs:
29+
ExecutionRoleArn:
30+
Value:
31+
Fn::GetAtt: ExecutionRole.Arn

GitLab-Projects-AccessToken/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
#
3+
# Set up any prerequisites needed for cfn test
4+
#
5+
mkdir -p inputs
6+
cat example_inputs/inputs_1_create.json | sed "s/GITLAB_PROJECT_ID/${GITLAB_PROJECT_ID}/g" > inputs/inputs_1_create.json
7+
cat test/integ-template.yml | sed "s/GITLAB_PROJECT_ID/${GITLAB_PROJECT_ID}/g" > test/integ.yml
8+

GitLab-Projects-AccessToken/template.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Description: AWS SAM template for the GitLab::Projects::AccessToken resource typ
55
Globals:
66
Function:
77
Timeout: 180 # docker start-up times can be long for SAM CLI
8-
MemorySize: 256
8+
MemorySize: 1024
99

1010
Resources:
1111
TypeFunction:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Resources:
2+
GitLabProjectsAccessToken:
3+
Type: GitLab::Projects::AccessToken
4+
Properties:
5+
Name: TestAccessToken
6+
ProjectId: GITLAB_PROJECT_ID
7+
AccessLevel: 30
8+
Scopes:
9+
- api
10+
- write_repository

0 commit comments

Comments
 (0)