-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcopier.yaml
154 lines (138 loc) · 3.77 KB
/
copier.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# questions
resource_name:
type: str
help: the name of your custom resource type?
validator: >-
{% if not (resource_name | regex_search('^[A-Z][a-zA-Z0-9]+$')) %}
Must be a CloudFormation logical name, only letter and digits. excluding Custom::
{% endif %}
resource_type_name:
type: str
help: the full custom resource type name in CloudFormation. just press return.
default: "Custom::{{resource_name}}"
when: false
validator: >-
{% if resource_type_name != ("Custom::" + resource_name) %}
The type name must be Custom::{{resource_name}}.
{% endif %}
resource_file_name:
type: str
help: the python custom resource module base filename. just press return.
when: false
default: >-
{{ resource_name |
regex_replace('(.)([A-Z][a-z]+)', '\\1_\\2') |
regex_replace('([a-z0-9])([A-Z])', '\\1_\\2') | lower }}
validator: |
{% if not (resource_file_name | regex_search('[a-z0-9_]_')) %}
the filename must only consist of lowercase letters, digits and underscore.
{% endif %}
project_name:
type: str
help: The name of your resource provider project?
default: >-
cfn-{{ resource_file_name | regex_replace('_', '-') }}-provider
validator: >-
{% if not (project_name|regex_search('^[a-z][a-z0-9-]+$')) %}
must be all lowercase letters or digits with optional dashes.
{% endif %}
module_name:
type: str
help: The name of your Python module?
default: >-
{{ project_name | regex_replace('-', '_') }}
validator: >-
{% if not (module_name| regex_search('^[a-z][a-z0-9_]+$')) %}
must be all lowercase letters or digits with optional underscore.
{% endif %}
description:
type: str
help: a short description for the custom provider?
default: >-
manages {{resource_name |
regex_replace('(.)([A-Z][a-z]+)', '\\1 \\2') |
regex_replace('([a-z0-9])([A-Z])', '\\1 \\2') |
lower}}s
python_version:
type: str
help: Python version to use
default: '3.12'
choices:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
author:
type: str
help: Your full name?
validator: |
{% if not author.strip() %}
Slightly more than nothing would be awesome!
{% endif %}
author_email:
type: str
help: Your email address?
validator: |
{% if not (author_email | regex_search('([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\\.[A-Z|a-z]{2,})+')) %}
Must be an email address.
{% endif %}
url:
type: str
help: the URL to git source repository?
default: >-
https://github.com/{{ author_email | regex_replace('[^@]*@', '') | regex_replace('\\.', '-')}}/{{project_name}}
aws_profile:
type: str
help: the AWS profile name
default: default
validator: >-
{% if not aws_profile %}
aws profile name must be specified
{% endif %}
aws_account:
type: str
help: source account for the AWS ECR image repository
validator: >-
{% if not (aws_account | regex_search('^[0-9]{12}$')) %}
aws account must be 12 digits
{% endif %}
aws_region:
type: str
help: the AWS region name
default: eu-central-1
validator: >-
{% if not (aws_region | regex_search('^[a-z]{2}-[a-z]+-[0-9]$')) %}
specify an AWS region name, like eu-central-1 or ap-southeast-2.
{% endif %}
allow_public_access:
type: bool
help: Allow public access to the lambda image?
_skip_if_exists:
- tests/**
- 'src/{{module_name}}/**'
- 'cloudformation/demo*'
- 'cloudformation/{{project_name}}.yaml'
- README.md
- setup.cfg
- .release
- Pipfile
- pyproject.toml
_exclude:
- copier.yaml
- ~*
- __pycache__
- .DS_Store
- .git
- .idea
- build
- dist
- venv
- README.md
_tasks:
# do a git init
- >-
[[ ! -d .git ]] &&
( git init &&
git add . &&
git commit -m 'initial import'
&& git tag 0.0.0) || exit 0