brave-dinner-47346
02/25/2022, 3:09 PM- 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"
busy-agent-35515
02/25/2022, 3:31 PM[//]: <> (infracost-comment)
markdown comment. That's how we track them. It should be visible in comment's editorbrave-dinner-47346
02/25/2022, 3:42 PM[//]: <> (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>
busy-agent-35515
02/25/2022, 3:44 PMinfracost
. 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.brave-dinner-47346
02/25/2022, 3:47 PM[//]: <> (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"
busy-agent-35515
02/25/2022, 3:49 PMGITLAB_TOKEN_FED_EMR
and env var or a tag value?brave-dinner-47346
02/25/2022, 3:50 PMbusy-agent-35515
02/25/2022, 3:51 PMGITLAB_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
?brave-dinner-47346
02/25/2022, 3:55 PM- 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>
busy-agent-35515
02/25/2022, 3:58 PMbrave-dinner-47346
02/25/2022, 3:58 PMbusy-agent-35515
02/25/2022, 3:59 PMbrave-dinner-47346
02/25/2022, 4:02 PM$ 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"
busy-agent-35515
02/25/2022, 4:03 PMinfracost
tag?brave-dinner-47346
02/25/2022, 4:04 PMimage:
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>
busy-agent-35515
02/25/2022, 4:11 PMbrave-dinner-47346
02/25/2022, 4:13 PMGitLab Enterprise Edition 13.12.9-ee
busy-agent-35515
02/25/2022, 4:13 PMbrave-dinner-47346
02/25/2022, 4:14 PMbusy-agent-35515
02/25/2022, 4:17 PMapi
for read and write requestsbrave-dinner-47346
02/25/2022, 4:26 PMbusy-agent-35515
02/25/2022, 4:28 PMbrave-dinner-47346
02/25/2022, 4:28 PMbusy-agent-35515
02/25/2022, 5:43 PMcurl -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 šbrave-dinner-47346
02/28/2022, 1:27 PM<title>The page you're looking for could not be found (404)</title>
busy-agent-35515
02/28/2022, 1:32 PM$CI_SERVER_URL/api/graphql
if it's the same as for the gitlab.com. Could you please try again?brave-dinner-47346
02/28/2022, 1:34 PM{"data":{"project":null}}%
busy-agent-35515
02/28/2022, 1:40 PM{"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"}]}}}}}%
brave-dinner-47346
03/01/2022, 11:59 AM.com/mmsys/fed/EMR
com/mmsys/fed/EMR/-/merge_requests/10
busy-agent-35515
03/01/2022, 12:26 PMmmsys
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 šbrave-dinner-47346
03/01/2022, 1:28 PMbusy-agent-35515
03/01/2022, 4:29 PMProject 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?brave-dinner-47346
03/02/2022, 10:01 AMbusy-agent-35515
03/02/2022, 10:16 AMbrave-dinner-47346
03/02/2022, 10:18 AMbusy-agent-35515
03/02/2022, 10:20 AMbrave-dinner-47346
03/02/2022, 10:30 AMbusy-agent-35515
03/02/2022, 10:31 AMbrave-dinner-47346
03/02/2022, 10:39 AMbusy-agent-35515
03/02/2022, 10:45 AMbrave-dinner-47346
03/02/2022, 10:47 AM