Bryce Bonvillain
- infracost comment gitlab
--gitlab-server-url $CI_SERVER_URL
--gitlab-token $GITLAB_TOKEN
--path infracost.json
--repo $CI_PROJECT_PATH
--merge-request $CI_MERGE_REQUEST_IID
--behavior update
Logs:
time="2022-02-25T14:44:44Z" level=info msg="Finding matching comments for tag infracost-comment"
time="2022-02-25T14:44:44Z" level=info msg="Found 0 matching comments"
time="2022-02-25T14:44:44Z" level=info msg="Creating new comment"
Vadim (Infracost)
[//]: <> (infracost-comment)
markdown comment. That's how we track them. It should be visible in comment's editorBryce Bonvillain
[//]: <> (infracost)
š° Infracost estimate: **monthly cost will not change**
<table>
<thead>
<td>Project</td>
<td>Previous</td>
<td>New</td>
<td>Diff</td>
</thead>
<tbody>
<tr>
<td>mmsys/fed/EMR/terraform/test.json</td>
<td align="right">$0</td>
<td align="right">$0</td>
<td>$0</td>
</tr>
</tbody>
</table>
<details>
<summary><strong>Infracost output</strong></summary>
Vadim (Infracost)
infracost
. If you use the CI command without the --tag infracost
flag, it will start searching for infracost-comment
. So this one won't be matched.Bryce Bonvillain
[//]: <> (infracost-comment)
š° Infracost estimate: **monthly cost will not change**
<table>
<thead>
<td>Project</td>
<td>Previous</td>
<td>New</td>
<td>Diff</td>
</thead>
<tbody>
<tr>
<td>mmsys/fed/EMR/terraform/mmsys-preprod-plan.out.json</td>
<td align="right">$0</td>
<td align="right">$0</td>
<td>$0</td>
</tr>
</tbody>
</table>
<details>
<summary><strong>Infracost output</strong></summary>
infracost comment gitlab \
--gitlab-server-url <https://gitlab.com> \
--repo mmsys/fed/EMR \
--merge-request 10 \
--tag GITLAB_TOKEN_FED_EMR \
--path infracost.json \
--behavior update \
--gitlab-token $TOKEN \
--log-level debug
time="2022-02-25T16:46:45+01:00" level=info msg="Finding matching comments for tag GITLAB_TOKEN_FED_EMR"
time="2022-02-25T16:46:45+01:00" level=info msg="Found 0 matching comments"
time="2022-02-25T16:46:45+01:00" level=info msg="Creating new comment"
Vadim (Infracost)
GITLAB_TOKEN_FED_EMR
and env var or a tag value?Bryce Bonvillain
Vadim (Infracost)
GITLAB_TOKEN_FED_EMR
in them, it won't match. Could you please change your TF file and push it again? Currently I'm seeing you using 3 different tags (default one, infracost
and GITLAB_TOKEN_FED_EMR
)infracost
tag, could you try to use --tag infracost
?Bryce Bonvillain
- infracost breakdown --sync-usage-file
--usage-file infracost-usage.yml
--format json --path ${PLAN}.json
--out-file infracost.json
- infracost comment gitlab
--gitlab-server-url $CI_SERVER_URL
--gitlab-token $GITLAB_TOKEN
--path infracost.json
--tag infracost
--repo $CI_PROJECT_PATH
--merge-request $CI_MERGE_REQUEST_IID
--behavior update
[//]: <> (infracost)
š° Infracost estimate: **monthly cost will not change**
<table>
<thead>
<td>Project</td>
<td>Previous</td>
<td>New</td>
<td>Diff</td>
</thead>
<tbody>
<tr>
<td>mmsys/fed/EMR/terraform/mmsys-preprod-plan.out.json</td>
<td align="right">$0</td>
<td align="right">$0</td>
<td>$0</td>
</tr>
</tbody>
</table>
<details>
<summary><strong>Infracost output</strong></summary>
Vadim (Infracost)
Bryce Bonvillain
Vadim (Infracost)
Bryce Bonvillain
$ infracost comment gitlab --gitlab-server-url $CI_SERVER_URL --gitlab-token $GITLAB_TOKEN --path infracost.json --tag infracost --repo $CI_PROJECT_PATH --merge-request $CI_MERGE_REQUEST_IID --behavior update
time="2022-02-25T16:01:40Z" level=info msg="Finding matching comments for tag infracost"
time="2022-02-25T16:01:41Z" level=info msg="Found 0 matching comments"
time="2022-02-25T16:01:41Z" level=info msg="Creating new comment"
Vadim (Infracost)
infracost
tag?Bryce Bonvillain
image:
name: infracost/infracost:ci-0.9
[//]: <> (infracost)
š° Infracost estimate: **monthly cost will not change**
<table>
<thead>
<td>Project</td>
<td>Previous</td>
<td>New</td>
<td>Diff</td>
</thead>
<tbody>
<tr>
<td>mmsys/fed/EMR/terraform/mmsys-preprod-plan.out.json</td>
<td align="right">$0</td>
<td align="right">$0</td>
<td>$0</td>
</tr>
</tbody>
</table>
<details>
<summary><strong>Infracost output</strong></summary>
Project: mmsys/fed/EMR/terraform/mmsys-preprod-plan.out.json
+ module.s3_log_storage.aws_s3_bucket.default[0]
Monthly cost depends on usage
+ Standard
+ Storage
Monthly cost depends on usage
+$0.0245 per GB
+ PUT, COPY, POST, LIST requests
Monthly cost depends on usage
+$0.0054 per 1k requests
+ GET, SELECT, and all other requests
Monthly cost depends on usage
+$0.00043 per 1k requests
+ Select data scanned
Monthly cost depends on usage
+$0.00225 per GB
+ Select data returned
Monthly cost depends on usage
+$0.0008 per GB
+ Standard - infrequent access
+ Storage
Monthly cost depends on usage
+$0.0135 per GB
+ PUT, COPY, POST, LIST requests
Monthly cost depends on usage
+$0.01 per 1k requests
+ GET, SELECT, and all other requests
Monthly cost depends on usage
+$0.001 per 1k requests
+ Retrievals
Monthly cost depends on usage
+$0.01 per GB
+ Select data scanned
Monthly cost depends on usage
+$0.00225 per GB
+ Select data returned
Monthly cost depends on usage
+$0.01 per GB
+ Glacier flexible retrieval
+ Storage
Monthly cost depends on usage
+$0.00405 per GB
+ PUT, COPY, POST, LIST requests
Monthly cost depends on usage
+$0.036 per 1k requests
+ GET, SELECT, and all other requests
Monthly cost depends on usage
+$0.00043 per 1k requests
+ Retrieval requests (standard)
Monthly cost depends on usage
+$0.036 per 1k requests
+ Retrievals (standard)
Monthly cost depends on usage
+$0.012 per GB
+ Select data scanned (standard)
Monthly cost depends on usage
+$0.0096 per GB
+ Select data returned (standard)
Monthly cost depends on usage
+$0.012 per GB
+ Retrieval requests (expedited)
Monthly cost depends on usage
+$12.00 per 1k requests
+ Retrievals (expedited)
Monthly cost depends on usage
+$0.036 per GB
+ Select data scanned (expedited)
Monthly cost depends on usage
+$0.024 per GB
+ Select data returned (expedited)
Monthly cost depends on usage
+$0.036 per GB
+ Select data scanned (bulk)
Monthly cost depends on usage
+$0.0012 per GB
+ Select data returned (bulk)
Monthly cost depends on usage
+$0.003 per GB
+ Early delete (within 90 days)
Monthly cost depends on usage
+$0.00405 per GB
Monthly cost change for mmsys/fed/EMR/terraform/mmsys-preprod-plan.out.json
Amount: $0.00 ($0.00 ā $0.00)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Key: ~ changed, + added, - removed
37 cloud resources were detected:
ā 1 was estimated, 1 includes usage-based costs, see https://infracost.io/usage-file
ā 1 wasn't estimated, report it in https://github.com/infracost/infracost:
ā 1 x aws_emr_cluster
ā 35 were free:
ā 8 x aws_security_group_rule
ā 5 x aws_security_group
ā 3 x aws_iam_role
ā 3 x aws_iam_role_policy_attachment
ā 2 x aws_network_acl
ā 2 x aws_route_table
ā 2 x aws_route_table_association
ā 2 x aws_subnet
ā 1 x aws_default_security_group
ā 1 x aws_iam_instance_profile
ā 1 x aws_internet_gateway
ā 1 x aws_key_pair
ā 1 x aws_route
ā 1 x aws_s3_bucket_public_access_block
ā 1 x aws_vpc
ā 1 x aws_vpc_endpoint</details>
This comment will be updated when the cost estimate changes.
<sub>
Is this comment useful? <a href="<https://www.infracost.io/feedback/submit/?value=yes>" rel="noopener noreferrer" target="_blank">Yes</a>, <a href="<https://www.infracost.io/feedback/submit/?value=no>" rel="noopener noreferrer" target="_blank">No</a>
</sub>
Vadim (Infracost)
Bryce Bonvillain
GitLab Enterprise Edition 13.12.9-ee
Vadim (Infracost)
Bryce Bonvillain
Vadim (Infracost)
api
for read and write requestsBryce Bonvillain
Vadim (Infracost)
Bryce Bonvillain
Vadim (Infracost)
curl -X POST \
-H "Authorization: Bearer $GITLAB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{project(fullPath: \"mmsys/fed/EMR\") {mergeRequest(iid: \"10\") {notes { nodes {id url createdAt body}}}}}"}' \
$CI_SERVER_URL
I think you just need to have the token and the url env vars set up and it should work. Well, we'll see šBryce Bonvillain
<title>The page you're looking for could not be found (404)</title>
Vadim (Infracost)
$CI_SERVER_URL/api/graphql
if it's the same as for the gitlab.com. Could you please try again?Bryce Bonvillain
{"data":{"project":null}}%
Vadim (Infracost)
{"data":{"project":{"mergeRequest":{"notes":{"nodes":[]}}}}}%
and with one comment returned:{"data":{"project":{"mergeRequest":{"notes":{"nodes":[{"id":"<gid://gitlab/Note/1>","url":"<http://gitlab.example.com/root/terraform-test/-/merge_requests/1#note_1>","createdAt":"2022-03-01T11:04:04Z","body":"foobar"}]}}}}}%
Bryce Bonvillain
.com/mmsys/fed/EMR
com/mmsys/fed/EMR/-/merge_requests/10
Vadim (Infracost)
mmsys
the org and fed/EMR
a project name? Or mmsys/fed
and EMR
? Sorry, I don't have much experience with GitLab, so trying to understand where to investigate next šBryce Bonvillain
Vadim (Infracost)
Project Access Tokens
with api or all scopes. Then I switched the test repo to be public and the curl request started to return proper data. And then I use Personal Access Token
with api scope and private repo - it also worked. Here's the response{"data":{"project":{"mergeRequest":{"notes":{"nodes":[{"id":"<gid://gitlab/Note/2>","url":"<http://gitlab.example.com/mssys/fed/emr/-/merge_requests/1#note_2>","createdAt":"2022-03-01T16:22:55Z","body":"foobar"}]}}}}}%
The infracost comment
command also worked with that access token.
Could you please double check what kind of token do you use?Bryce Bonvillain
Vadim (Infracost)
Bryce Bonvillain
Vadim (Infracost)
Bryce Bonvillain
Vadim (Infracost)
Bryce Bonvillain
Vadim (Infracost)